p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   C# (http://p2p.wrox.com/forumdisplay.php?f=22)
-   -   SqlParameterCollections (http://p2p.wrox.com/showthread.php?t=17463)

CodeMonkeys August 26th, 2004 08:05 AM

SqlParameterCollections
 
Hi

i am looking for any examples on SqlParameterCollections in c#

i have an arraylist and want to this into a SqlParameterCollections

CodeMonkeys

mehdi62b August 27th, 2004 07:43 AM

Have a look at this example...(although I dont know your exact meaning)
Code:

public void AddSqlParameters()
{
// ...
// create myDataSet and myDataAdapter
// ...

  myDataAdapter.SelectCommand.Parameters.Add("@CategoryName", SqlDbType.VarChar, 80).Value = arraylist[0];
  myDataAdapter.SelectCommand.Parameters.Add("@SerialNum", SqlDbType.Int).Value = arraylist[1];
  myDataAdapter.Fill(myDataSet);

}

also instead of SqlParameters you can work with objDataRow.ItemArray for filling your arraylist according a row in your datasource.
HtH.

--------------------------------------------
Mehdi.:)


All times are GMT -4. The time now is 05:06 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.