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

Which object holds only data and does not interact with data source?

912


Is it possible to load multiple tables in a Dataset?

1003


How is entity framework different from ado.net?

907


What is defaultview in datatable?

989


Explain the dataadapter class in ado.net?

1127


What is aggregate root?

1001


What is Data view?

1008


What are the benefits of ADO.NET?

1063


Is entity framework better than ado.net?

933


How to store data in memory?

892


What is ado.net object model?

920


What are all the different authentication techniques used to connect to MS SQL Server?

1010


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?

923


What are the essential features of ado.net?

899


What are the different methods available under the sqlcommand class to access the data?

1001