Call a stored procedure from ado.net and pass parameter to it ?
Answer Posted / suman zalodiya
SqlConnection con = new SqlConnection("Your Databse
Connection String");
SqlCommand cmd = new SqlCommand("Stored Procedure Name",
con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@source", SqlDbType.VarChar, 50).Value
= TextBox1.Text;
cmd.Parameters.Add("@destination", SqlDbType.VarChar,
50).Value = TextBox2.Text;
con.Open();
cmd.ExecuteNonQuery();
con.Close();
Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
Compare Data Reader & Dataset in ado.net?
What is sqldatasource?
Define different execute methods of ADO.NET command object ?
What we do with the object of ado.net dataset after using it?
What is the difference between Response.Expires and Reponse.ExpiresAbsolute?
What is the difference between SqlCommand and SqlCommandBuilder?
what is the difference betwen typed dataset and untyped dataset?in general which dataset can we use in programming?
What are the ado.net objects?
Explain the dataadapter class in ado.net?
What is difference between Dataview and Datatable?
Define table relations?
What is Data Provider?
What is the return type of executescalar?
What are the key features of ado.net?
What are the essential features of ado.net?