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 are the different namespaces used in the project to connect the database? What data providers available in .net to connect to database?

1271


What is a datareader object?

1042


What is a dynaset in access?

1014


What is sql command in ado net?

906


Explain the difference between ado and ado.net?

877


Name which operations can you not perform on an ado.net dataset?

921


Explain executenonquery?

1065


What is the full form of ado.net?

929


What are the benefits of ADO.NET?

1060


Explain all the classes those are used for database connections between sql server and asp.net?

949


What is the purpose of using adodb?

897


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

866


Explain the basic use of "dataview" and explain its methods.

934


What Is Difference Between Ado And Ado.net?

972


Can datareader hold data from multiple tables?

1109