Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Parameter arrays
Message
De
15/07/2003 11:40:24
Jason Mesches
Ocean Systems Engineering Corporation
Carlsbad, Californie, États-Unis
 
 
À
14/07/2003 15:48:20
Rex Mahel
Realm Software, Llc
Ohio, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
00809965
Message ID:
00810238
Vues:
28
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform