How do we call and execute a Stored Procedure in Dot Net?

 Posted by vishalneeraj-24503 on 1/11/2014 | Category: ADO.NET Interview questions | Views: 1011 | Points: 40
Answer:

By Using SqlCommand object of System.Data.SqlClient namespace,we can execute our Stored Procedure from Code-Behind

We have to pass Stored Procedure Name in CommandText property of SqlCommand object as:-

cmd.CommandType = CommandType.StoredProcedure;

cmd.Commandtext = "our stored procedure name";
cmd.ExecuteNonQuery();


Here,cmd is or SqlCommand object.


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response