DataAdapter

  • Thread starter Thread starter Shalini Noronha
  • Start date Start date
S

Shalini Noronha

Hi

I use a DataAdapter. To which is pass a Stored Proc and
Connection

SqlDataAdapter DA = new SqlDataAdapter("storedProd",Conn);
how do i pass parameters to my stored proc

Kindly Help
 
Shalini,

You should create a SqlCommand object

SqlClient.SqlCommand SqlCommand;
SqlCommand.CommandText = "storedProd";
SqlCommand.CommandType = CommandType.StoredProcedure;
SqlCommand.Parameters.Add(New SqlClient.SqlParameter("@MyFirstParameter",
[Value As Object]);
SqlCommand.Parameters.Add(New SqlClient.SqlParameter("@MySecondParameter",
[Value As Object]);

SqlCommand.Connection = Conn

SqlDataAdapter DA = new SqlDataAdapter(SqlCommand);

Sincerely,

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
 
Back
Top