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
Can we do database operations without using any of the ado.net objects?
What are the different layers of ado.net?
What are the namespaces used in ado.net for data access?
What does ado stand for?
How to check if the Dataset has records ?
What is commandbuilder in ado.net?
What are typed and untyped dataset?
What are the data access namespaces in .NET?
What does ole stand for in excel?
What is the difference between sqlcommand and sqldataadapter?
Which is faster datareader or dataadapter?
Explain the difference between sqlcommand object and command behavior object?
What is bubbled event?
Compare Data Reader & Dataset in ado.net?
What is the difference between Data adaptor and Data set?