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
Which is better ole db or odbc?
Define isolation?
What is the use of data grid?
What is sqlconnection and sqlcommand?
What are disadvantages of microsoft-provided data provider classes in ado.net?
What is shadow copy?
What is difference between executequery and executeupdate?
What does executereader return?
List the 4 common ado.net namespaces?
Explain the different row versions available in table?
Define connection string?
What is ado object model?
What is ado oledb and odbc?
What is data relation in ado.net?
What is an ADO.Net?