Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Custom data access class - IDataAdapter.SelectCommand
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
00950319
Message ID:
00950550
Views:
17
Ric,

>Where I'm struggling is, I don't see how to use, from within my MM.NET business object, the four SqlCommand objects that are defined in my new data access class's IDataAdapter (i.e., SelectCommand, InsertCommand, DeleteCommand, UpdateCommand).

>Please consider this code from my Vendor business object:
>
>
>public DataSet GetVendors()
>{
>	VendorDataSet ds = new VendorDataSet();
>	mmDataAccessBase dao = this.GetDataAccessObject();
>	IDataAdapter da = dao.CreateDataAdapter();
>	da.Fill(ds);
>	return ds;
>}
>
>
>I get the distinct feeling that I am supposed be using the "this.FillDataSet(ds,...)" method instead of the "da.Fill(ds)" method.

It's actually much easier than that. All you have to do is call GetDataSet() or FillDataSet() on the business object and the call will automatically be passed to your custom data access object. In this particular example you don't need to create a data access object or a data adapter. All you need to do is this:
public DataSet GetVendors()
{
    // Pass whatever parameters you need here, or call FillDataSet 
    // if you have an existing ds you want to fill
    return this.GetDataSet(); 
}
Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform