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 / 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

Does entity framework use ado.net?

968


Is datareader faster than datatable?

958


Define bubbled event?

920


What is basic use of data view?

997


What is the difference between a datareader and a dataset?

1027


Explain the difference between sqlcommand object and command behavior object?

1078


What is serialization and de-serialization in .net?

919


How to enable and disable connection pooling?

1043


What is the role of data provider in ado.net?

996


What is a string variable?

909


Explain the difference between ado and ado.net?

935


What is disconnected architecture in ado.net?

978


Explain the advantage of ADO.Net?

987


What is ado asp?

986


Explain the differences between oledb sql server, oledbdotnet provider?

1000