Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Which is better ole db or odbc?

863


Define isolation?

922


What is the use of data grid?

912


What is sqlconnection and sqlcommand?

1014


What are disadvantages of microsoft-provided data provider classes in ado.net?

970


What is shadow copy?

938


What is difference between executequery and executeupdate?

929


What does executereader return?

902


List the 4 common ado.net namespaces?

1092


Explain the different row versions available in table?

989


Define connection string?

1020


What is ado object model?

900


What is ado oledb and odbc?

882


What is data relation in ado.net?

1000


What is an ADO.Net?

934