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
Which object holds only data and does not interact with data source?
Is it possible to load multiple tables in a Dataset?
How is entity framework different from ado.net?
What is defaultview in datatable?
Explain the dataadapter class in ado.net?
What is aggregate root?
What is Data view?
What are the benefits of ADO.NET?
Is entity framework better than ado.net?
How to store data in memory?
What is ado.net object model?
What are all the different authentication techniques used to connect to MS SQL Server?
What provider ado.net use by default? Explain the role of data provider in ado.net? What is the role of data provider in ado.net?
What are the essential features of ado.net?
What are the different methods available under the sqlcommand class to access the data?