﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Business Objects and Data Access (How do I?)  » How to use BO.FillByPrimaryKey(Int64 (Long) Parameter Array)?</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Fri, 18 Sep 2026 05:20:50 GMT</lastBuildDate><ttl>20</ttl><item><title>How to use BO.FillByPrimaryKey(Int64 (Long) Parameter Array)?</title><link>http://forum.strataframe.net/FindPost23215.aspx</link><description>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?&lt;br&gt;
&lt;br&gt;
So far, I can enumerate the BO2 like this:&lt;br&gt;
&lt;br&gt;
[codesnippet]&lt;br&gt;
' Here I need to code to create the Parameter Array&lt;br&gt;
 For Each ItemsBO As bizTransactionItems In Me.BizTransactionItems1.GetEnumerable&lt;br&gt;
                ' Here I need the code to increment the Parameter Array&lt;br&gt;
&lt;br&gt;
            Next&lt;br&gt;
&lt;br&gt;
'  BO.FillByPrimaryKey(Int64 (Long) Parameter Array)&lt;br&gt;
[/codesnippet]&lt;br&gt;
&lt;br&gt;
Thanks!</description><pubDate>Tue, 26 May 2009 07:21:07 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: How to use BO.FillByPrimaryKey(Int64 (Long) Parameter Array)?</title><link>http://forum.strataframe.net/FindPost23231.aspx</link><description>Cool :cool:</description><pubDate>Tue, 26 May 2009 07:21:07 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: How to use BO.FillByPrimaryKey(Int64 (Long) Parameter Array)?</title><link>http://forum.strataframe.net/FindPost23228.aspx</link><description>[quote][b]Trent L. Taylor (05/26/2009)[/b][hr]Let me know if this is not what you were getting at.[/quote]&lt;br&gt;
Thanks, that is exactly what I was looking for.</description><pubDate>Tue, 26 May 2009 07:13:18 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: How to use BO.FillByPrimaryKey(Int64 (Long) Parameter Array)?</title><link>http://forum.strataframe.net/FindPost23226.aspx</link><description>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.&lt;br&gt;
&lt;br&gt;
[codesnippet]&lt;br&gt;
Dim pks As New System.Collections.Generic.List(Of Long)&lt;br&gt;
&lt;br&gt;
For Each bo As BO1 in BO1.GetEnumerable()&lt;br&gt;
   pks.Add(bo.MyPk)&lt;br&gt;
Next&lt;br&gt;
&lt;br&gt;
BO2.FillByPrimaryKey(pks.ToArray())&lt;br&gt;
&lt;br&gt;
[/codesnippet]&lt;br&gt;
&lt;br&gt;
Let me know if this is not what you were getting at.</description><pubDate>Tue, 26 May 2009 07:10:56 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>