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

What is sequence of code in retrieving data from database ?

Answer Posted / manoj batra

If using DataSet :
1) Create a connection object
2) Create a DataAdapter object
3) Associate your query and connection with DataAdapter
4) Create DataSet object
5) Fill the dataset with desired result using Fill method of
DataAdapter.
6) start retriving the data into your container from dataset.
Note : DataAdapter automatically Open and Close the connection.

If using DataReader:
1) Create connection object
2) Oen connection
3) Create Command object
4) Create DataReader object
5) Associate your Sql command with the command object
6) Use ExecuteDataReader method inside the loop (The
selective Sql query may return more than one Row)
Note : DataReader is Readonly and ForwardOnly operation.
7) Return result in control(s).
8) Close the connection

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is fill method in ado.net?

1026


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

1094


Which ado.net object is very fast in getting data from the database?

1146


Which components of a data provider is used to retrieve, insert, delete, or modify data in a data source?

1177


What are the namespaces used in ADO.Net to connect to a database?

1298


Explain why edit is not possible in repeater?

1095


What is aggregating data ?

1021


What is the difference between executequery and executenonquery?

966


What are the key features of ado.net?

1270


How can you add or remove rows from the datatable object of dataset?

1069


What is the full form of ado?

1083


What is dataadapter in ado.net?

957


What is ado net stands for?

1007


What is command class in ado.net?

1094


Explain the difference between ado and ado.net?

991