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
How to store data in memory?
What is sql connection in ado.net?
Give an example that shows how to execute a stored procedure in ado.net?
Why is stored procedure used in ado.net?
What is ado control?
Explain how to bind the controls(best practice) comboboxes to the data in the dataset?
What are the classes in System.Data.Common Namespace?
What is partial class?
Explain the dataadapter class in ado.net?
What is disconnected data?
What are the usages of the command object in ado.net?
What is disconnected scenario in entity framework?
Explain the difference between ado and ado.net?
Explain what are acid properties?
How would you connect to a database by using .NET?