StrataFrame Forum

sBeginner ? Fill BO with view

http://forum.strataframe.net/Topic4617.aspx

By Jon Olson - 11/17/2006

How can I fill the BO with view data?
By StrataFrame Team - 11/17/2006

Me.FillDataTable("SELECT * FROM [viewname]")

or

this.FillDataTable("SELECT * FROM [viewname]");

A business object's internal DataTable is not typed, so you can pull data from any number of columns into the business object.  So, you can take any bo, whether it has been mapped to the view or not and retrieve data into the bo.  However, if you try to save, that might cause you some problems Wink

If you ever want to retrieve a column value that does not have a corresponding strong-typed property on the BO, you can access the column through this:

bo.Item("fieldname")

or

bo.Item["fieldname"] //-- C#