DataAdapter

  • Thread starter Shalini Noronha
  • 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
 
S

S. Justin Gengo

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top