Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parameter arrays
Message
From
15/07/2003 11:40:24
Jason Mesches
Ocean Systems Engineering Corporation
Carlsbad, California, United States
 
 
To
14/07/2003 15:48:20
Rex Mahel
Realm Software, Llc
Ohio, United States
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
00809965
Message ID:
00810238
Views:
27
Rex,
If you check out the 11th override of either GetDataSet() or FillDataSet(), you'll see the last parameter is a params type. This allows you to pass as many of the IDbDataParameter objects as you need for your query:
mmDataAccessBase dao = this.GetDataAccessObject();
IDbDataParameter custIDParam = dao.CreateParameter("@CustID", custID);

IDbDataParameter prodIDParam = dao.CreateParameter("@ProductID", productID);
			
this.TableName = tableName;
this.FillDataSet(this.GetCurrentDataSet(), sqlExecComm, tableName, custIDParam, prodIDParam);
As you probably guessed, sqlExecComm is the SQL string, tableName is the name of the DataTable, and we're using 2 parameters for this query.

Hope that sheds some light,
---J


>David,
>
>This example shows 1 parameter, I am looking for several parameters in an array.
>
>Thanks
>
>Rex
>
>>This uses FillDataSet, but just replace that with GetDataSet
>>
>>
>>public virtual DataSet GetOrderByPK(int orderId, String tableName)
>>{
>>
>>DataSet dsOrders = this.GetCurrentDataSet();
>>
>>String sql = "SELECT Orders.* FROM  Orders WHERE uOrdID = @uOrdID ";
>>mmDataAccessBase dao = this.GetDataAccessObject();
>>IDbDataParameter param = dao.CreateParameter("@uOrdID", orderId);
>>
>>this.FillDataSet(dsOrders,sql,tableName,param);
>>return dsOrders;
>>}
>>
>>
>>>All,
>>>
>>>Can I get an example of the GetDataSet method of mmBusinessObject using an iDbDataParameter array?
>>>
>>>Thanks
>>>
>>>Rex
Previous
Reply
Map
View

Click here to load this message in the networking platform