StrataFrame Forum

Is it possible to copy Business objects to pure dotnet table?

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

By Raymond Lo - 6/21/2009

Dear All,

       I need to implement the Infragistics ultragrid to my application. So I need to bind the datasource to donet table or dataset. So my question is: Can I copy the business object to dotnet standalone table (copy the structure and the data) ? like as businessobject.CopyFrom function.

Thanks.

By Trent L. Taylor - 6/22/2009

You will want to just use the BusinessBindingSource to bind to a grid. It implements the IBindingList interface which a grid needs in order to bind. You can get more information on this in the documentation. But in short, just drop the BBS on the form where your BO instance resides, select the BBS and set the BusinessObject property to the instance you wish to wrap. At this point you will be able to bind to the grid.
By Paul Chase - 6/22/2009

Trent is right that the business binding source is what ya want to bind a BO to a grid.

However there may be times or reasons etc to where you will need to load data from a bo to a data table or dataset.

Datatable.Load(BusinessObject.CurrentView.ToTable.CreateDataReader)

Dataset.Tables(BusinessObject.TableName).Load(BusinessObject.CurrentView.ToTable.CreateDataReader)

By Raymond Lo - 6/22/2009

Hi Trent & Paul ,

Thank you very much.

 Paul's coding is what I need.