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


Please Help Members By Posting Answers For Below Questions

What is the difference between Optimistic and Pessimistic locking?

763


What is adodb dll?

762


Describe connection object in ado.net

774


What is ado circle?

896


Explain the difference in an abstract class and an interface?

723


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?

746


What are the data providers used in ado.net

751


How to retrieve the user id which is provided while windows authentication?

831


What is the usage of the dataset object in ado.net?

716


What are two types of transaction supported by ado.net?

766


What is ado in agriculture?

705


What is the use of sqldatareader class?

691


Why do we serialize data?

712


What are the objects of ado.net?

781


Define bubbled event?

703