Call a stored procedure from ado.net and pass parameter to it ?
Answer Posted / narayansahu
create a connection object
create a command object like so
SqlCommand comm=new SqlCommand("storedprocname",conn)
comm.commandtype=cmmandtype.storedprocedure
and then add parameters like:
comm.parameters.addwithvale("@userid",textbox1.text)
comm.parameters.addwithvalue(@username",textbox2.text)
that's it
Is This Answer Correct ? | 19 Yes | 4 No |
Post New Answer View All Answers
What is the maximum pool size in ado.net connection string?
What is sqldatareader?
What does ado stand for?
What is the return type of executescalar?
What do you know about ADO.NET's objects and methods?
What is the difference between ADO and ADO.Net?
How do you update a dataset in ado.net and how do you update database through dataset?
How to create data relations?
What is difference between executenonquery and executequery?
What are the disadvantages of using datalist?
What is difference between executequery and executeupdate?
Define atomicity?
What is ambient transaction?
Which method in OLEDBAdapter is used to populate dataset with records?
What are the classes in System.Data.Common Namespace?