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
What is datatable in ado.net?
Can we do database operations without using any of the ado.net objects?
How to enable and disable connection pooling?
What is variable view?
What is the namespaces being used to access oracle database?
What is difference between datareader and dataadapter?
differance between ADO vs ADO.Net?
What is data relation?
How to check if the Dataset has records ?
What is difference between ado.net and asp net?
What is serialization and de-serialization in .net? How can we serialize the dataset object?
Why ca not we use multiple inheritance and garbage collector paralelly in .net?
What is a string variable?
How do you update a dataset in ado.net and how do you update database through dataset?
Explain the architecture of ado.net?