StrataFrame Forum
Back
Login
Login
Home
»
StrataFrame Application Framework - V1
»
Business Objects and Data Access (How do I?)
»
In a Trial Version How Can I Fill the B.O.?
In a Trial Version How Can I Fill the B.O.?
Post Reply
Like
1
In a Trial Version How Can I Fill the B.O.?
View
Flat Ascending
Flat Descending
Threaded
Options
Subscribe to topic
Print This Topic
RSS Feed
Goto Topics Forum
Author
Message
Marcio Valerio Silva
Marcio Valerio Silva
posted 14 Years Ago
ANSWER
Topic Details
Share Topic
Group: Forum Members
Posts: 55,
Visits: 929
In a Trial Version How Can I Fill the Business Objects?
The Method FillTop100() showing in on-line Demo isn´t presente here!
Is it possible fill it with another Method? if yes How Can I? Or is only possible in paid version?
I want to buy , but I would like to try and learn something before.
Thanks!
at,
Marcio Valerio.
at,
Marcio Valerio da Silva
Reply
Like
1
Edhy Rijo
E
Edhy Rijo
posted 14 Years Ago
ANSWER
Post Details
Share Post
E
Group: StrataFrame Users
Posts: 2.4K,
Visits: 23K
Hi Marcio, and welcome to the forums.
Basically you are responsible to create the methods to be used to fill your BO with the data you want. 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.
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.
Edhy Rijo
Reply
Like
1
Greg McGuffey
Greg McGuffey
posted 14 Years Ago
ANSWER
Post Details
Share Post
Group: Forum Members
Posts: 2K,
Visits: 6.6K
Welcome to the forums
Marcio!
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.
FillByPrimaryKey: fill BO with a single record, using the PK of the table.
FillByParentPrimaryKey: fill BO with records matching a FK to a parent table (think fill orders for a single customer).
FillDataTable: This is what you'll use to build your own.
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.
/// <summary>
/// Fill the BO with the indicated number of records. This is
/// generic enough to use with any BO.
/// </summary>
public void FillTopN(int n)
{
//-- Build SQL Statement.
StringBuilder sqlBuilder = new StringBuilder();
sqlBuilder.AppendFormat("Select Top {0} *\n", n);
sqlBuilder.AppendFormat("From {0}", this.TableName);
//-- Load data.
using (SqlCommand cmd = new SqlCommand())
{
cmd.CommandText = sqlBuilder.ToString();
this.FillDataTable(cmd);
}
}
Let us know if you run into any problems.
Tags
BusinessObject
Fill Methods
Reply
Like
1
GO
Merge Selected
Merge into selected topic...
Merge into merge target...
Merge into a specific topic ID...
Open Merge
Post Reply
Like
1
Similar Topics
Post Quoted Reply
Reading This Topic
Login
Login
Remember Me
Reset Password
Resend Validation Email
Login
Explore
Messages
Mentions
Search