Interview Questions

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

.NET Database ,COM interop,and .NET deployment questions and answers


(Continued from previous question...)

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

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

(Continued on next question...)

Other Interview Questions