How do u call and execute a stored procedure in .NET?

Q

How do u call and execute a stored procedure in .NET?

✍: Guest

A

system.Data;
system.Data.SqlClient;

SqlConnection sqCon = new SqlConnection(”connection string”);
SqlCommand sqCmd = new SqCmd();
sqCmd.Connection = sqCon;
sqCmd.CommandText = procedure_name;
sqCmd.CommandType = CommandType.StoredProcedure;
sqComd.ExecuteReader();

regards - Raveendra Sharma

2014-11-14, 1671👍, 0💬