How to acces Stored procedure with ADO.NET?

  • Thread starter Thread starter Lamine Darbouche
  • Start date Start date
L

Lamine Darbouche

Please help!!
I am new with ado.net and would like to know how we can access stored
procedures in SQL2000?
I have been looking for code examples but could not see any?
Any ideas where I can find an example?
Many thanks.
Lamine
 
Hi

Here is the pseudo code:

SqlConnection sConn = new SqlConnection
("<<connectionstring>>")
sConn.Open() ;
SqlCommand sCmd1 = new SqlCommand
("<<StoredProcName>>",sConn) ;

sCmd1.CommandType = CommandType.StoredProcedure ;

sCmd1.Parameters.Add
("<<@SQLParamName",SqlDbType.VarChar,30,"");

sCmd1.Parameters["@SQLParamName"].Value = "";
sCmd1.ExecuteNonQuery();

HTH
Ravikanth[MVP]
 
Back
Top