How to use Stored procedures with examples?

Questions by nallamma

Showing Answers 1 - 2 of 2 Answers


  • Mar 19th, 2015

  1.  SqlCommand command = new SqlCommand("dbo.sp_name", (SqlConnection)session.Connection);

  2.  command.CommandType = CommandType.StoredProcedure;

  3.  command.Parameters.Add(new SqlParameter("@param_name1", "Param Value 1"));

  4.  command.Parameters.Add(new SqlParameter("@param_name2", "Param Value 1"));

  5.  command.ExecuteNonQuery();

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.


Related Answered Questions


Related Open Questions