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
2
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 15 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
2
Reply
Greg McGuffey
Greg McGuffey
posted 15 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
2
GO
Merge Selected
Merge into selected topic...
Merge into merge target...
Merge into a specific topic ID...
Open Merge
Threaded View
Threaded View
In a Trial Version How Can I Fill the B.O.?
Marcio Valerio Silva
-
15 Years Ago
Hi Marcio, and welcome to the forums. Basically you are responsible...
Edhy Rijo
-
15 Years Ago
Welcome to the forums Marcio! As Edhy said, you'll typically need to...
Greg McGuffey
-
15 Years Ago
Post Reply
Like
2
Similar Topics
Post Quoted Reply
Reading This Topic
Login
Login
Remember Me
Reset Password
Resend Validation Email
Login
Explore
Messages
Mentions
Search