How to use BO.FillByPrimaryKey(Int64 (Long) Parameter Array)?


Author
Message
Edhy Rijo
E
StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
I have a BO1 with some records, I need to fill another BO2 with the same records in BO1, I think that using the BO.FillByPrimaryKey(Int64 (Long) Parameter Array) may be a quick solution. Now I don't know how to code to create the Long parameter array needed for BO2.FillByPrimaryPK(), can somebody post some quick code on how to do this?



So far, I can enumerate the BO2 like this:





' Here I need to code to create the Parameter Array

For Each ItemsBO As bizTransactionItems In Me.BizTransactionItems1.GetEnumerable

' Here I need the code to increment the Parameter Array



Next



' BO.FillByPrimaryKey(Int64 (Long) Parameter Array)





Thanks!

Edhy Rijo

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
You will just need to create a collection of PKs. The easiest way is to create a generic List(Of Long) and then ToArray it. I would look something like this.





Dim pks As New System.Collections.Generic.List(Of Long)



For Each bo As BO1 in BO1.GetEnumerable()

pks.Add(bo.MyPk)

Next



BO2.FillByPrimaryKey(pks.ToArray())







Let me know if this is not what you were getting at.
Edhy Rijo
E
StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Trent L. Taylor (05/26/2009)
Let me know if this is not what you were getting at.


Thanks, that is exactly what I was looking for.

Edhy Rijo

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Cool Cool
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search