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 the difference between a Dataset and DataReader?
Can dataReader hold data from multiple tables?

Answer Posted / karna

data set a collection of datatables and we can edit the
data in the datatables and the same can be persisted to
databae using adapter in the disconnected maner by using
commandbuilder or insert,update,select command.

datareader is just the container for data,its readonly and
forwardonly curosr.this follows connected architecture,that
means when we are reading data from datareader at that time
connection should be kept open.

data reader can hold data from multiple tables and
datareader can hold more than one table.

Example:

string query="select * from employee;select * from student";
sqlcommand cmd=new sqlcommand(query,connection);
sqldatareader dr=cmd.executeReader();
if(dr.hasrows)
{
dr.read();
gridview1.DataSource=dr;
gridview1.Databind();
if(dr.nextresult)
{
gridview2.datasource=dr;
gridview2.databind();
}
}
dr'colse();
connection.close();

if anybody have any doubts,mail to me on karun84@gmail.com

Is This Answer Correct ?    14 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which is faster entity framework or ado.net?

937


What you mean by filtering of data?

974


Is it possible to load multiple tables in a Dataset?

1079


The answers which posted above is not satisfied my requirement? Can some one post teh exact answer? Thanx

2034


Describe the command object and its method.

1004


What is full form of ado?

1068


What are the data providers used in ado.net

1021


What is the default provider in ado.net?

965


What is openquery?

991


What are the different methods by which we can populate a dataset?

1240


Which one of the following objects is a high-level abstraction of the connection and command objects in ado.net?

1067


Explain the advantages and disadvantages of using datalist?

1074


Which object needs to be closed?

2262


Can we create Synonymns in MS Acess,My Sql Server,Sql Server? But iam we can create in oracle!

2142


How many major types of connection objects in ADO.NET?

1041