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 are the differences between OLEDB and SQLClient Providers?
What are the Data providers in ADO.Net?
What is the difference between data reader and data adapter?
Compare Data Reader & Dataset in ado.net?
What are the advantages and disadvantages of using datalist?
How can we save all data from dataset?
What is difference between datatable and dataset?
What is a dynaset in access?
Explain the differences between oledb sql server, oledbdotnet provider?
If a table contains 20000 records . In a page at each time 100 records to be displayed what are the steps you will take to improve performance? Will you use dataset or datareader?
What is dataset and datatable in ado.net?
What is a control toolbox?
What is data control techniques?
What is sqldatasource?
In how many ways we can retrieve table records count? How to find the count of records in a dataset?