﻿<?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?)  » In a Trial Version How Can I Fill the B.O.?</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 21 Apr 2026 02:55:48 GMT</lastBuildDate><ttl>20</ttl><item><title>In a Trial Version How Can I Fill the B.O.?</title><link>http://forum.strataframe.net/FindPost28646.aspx</link><description>In a Trial Version How Can I Fill the Business Objects?&lt;br/&gt;&lt;br/&gt;The Method FillTop100()&amp;nbsp;showing in on-line Demo&amp;nbsp;&amp;nbsp;isn´t presente here!&lt;br/&gt;&lt;br/&gt;&lt;img src="http://forum.strataframe.net/Uploads/Images/e54e40e4-d222-42af-881d-ae44.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;Is it possible fill it with another Method? if yes How Can I? Or is only possible in paid version?&lt;br/&gt;&lt;br/&gt;I want to buy , but I would like to try&amp;nbsp;and&amp;nbsp;learn something before.&lt;br/&gt;&lt;br/&gt;Thanks!&lt;br/&gt;&lt;br/&gt;at,&lt;br/&gt;&lt;br/&gt;Marcio Valerio.</description><pubDate>Fri, 08 Oct 2010 12:40:29 GMT</pubDate><dc:creator>Marcio Valerio Silva</dc:creator></item><item><title>RE: In a Trial Version How Can I Fill the B.O.?</title><link>http://forum.strataframe.net/FindPost28648.aspx</link><description>Welcome to the forums &lt;span id="ctl00_ctlContentPlaceHolder_ctl00_ctlTopic_ctlPanelBar_ctlTopicsRepeater_ctl01_lblFullMessage"&gt;Marcio!&lt;br/&gt;&lt;br/&gt;As Edhy said, you'll typically need to create fill methods (see the help file) to load the BO. There are a few that are built in that are pretty handy.&lt;br/&gt;&lt;br/&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;FillByPrimaryKey: fill BO with a single record, using the PK of the table.&lt;/li&gt;&lt;li&gt;FillByParentPrimaryKey: fill BO with records matching a FK to a parent table (think fill orders for a single customer).&lt;/li&gt;&lt;li&gt;FillDataTable: This is what you'll use to build your own.&lt;/li&gt;&lt;/ul&gt;&lt;br/&gt;Here is one I use in test apps a lot, just to load some data into a BO for some other test I'm doing. This goes into the BO code file.&lt;br/&gt;&lt;br/&gt;&lt;span&gt;[codesnippet]/// &amp;lt;summary&amp;gt;&lt;br/&gt;/// Fill the BO with the indicated number of records. This is &lt;br/&gt;/// generic enough to use with any BO. &lt;br/&gt;/// &amp;lt;/summary&amp;gt;&lt;br/&gt;public void FillTopN(int n)&lt;br/&gt;{&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //-- Build SQL Statement.&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; StringBuilder sqlBuilder = new StringBuilder();&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sqlBuilder.AppendFormat("Select Top {0} *\n", n);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sqlBuilder.AppendFormat("From {0}", this.TableName);&lt;br/&gt;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //-- Load data.&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; using (SqlCommand cmd = new SqlCommand())&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cmd.CommandText = sqlBuilder.ToString();&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.FillDataTable(cmd);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br/&gt;}[/codesnippet]&lt;br/&gt;&lt;br/&gt;Let us know if you run into any problems.&lt;br/&gt;&lt;/span&gt;</description><pubDate>Fri, 08 Oct 2010 12:40:29 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: In a Trial Version How Can I Fill the B.O.?</title><link>http://forum.strataframe.net/FindPost28647.aspx</link><description>Hi Marcio, and welcome to the forums.&lt;br/&gt;&lt;br/&gt;Basically you are responsible to create the methods to be used to fill your BO with the data you want.&amp;nbsp; As done in the sample you can create any method you want in the BO that will fill the internal datatable with the records you want.&lt;br/&gt;&lt;br/&gt;About the Trial, it will let you do anything you need to test as with the Paid version, so go for it, create your own method and call that method to fill your BO, use the sample code in FillTop100 to see how to create your SELECT statement to get your data.</description><pubDate>Fri, 08 Oct 2010 11:48:23 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item></channel></rss>