ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
 
Categories  >>  Software  >>  Microsoft Related  >>  ADO.NET
 
 


 

 
 Visual Basic interview questions  Visual Basic Interview Questions
 C Sharp interview questions  C Sharp Interview Questions
 ASP.NET interview questions  ASP.NET Interview Questions
 VB.NET interview questions  VB.NET Interview Questions
 COM+ interview questions  COM+ Interview Questions
 ADO.NET interview questions  ADO.NET Interview Questions
 IIS interview questions  IIS Interview Questions
 MTS interview questions  MTS Interview Questions
 Crystal Reports interview questions  Crystal Reports Interview Questions
 BizTalk interview questions  BizTalk Interview Questions
 Dot Net interview questions  Dot Net Interview Questions
 Exchange Server interview questions  Exchange Server Interview Questions
 SharePoint interview questions  SharePoint Interview Questions
 Microsoft Related AllOther interview questions  Microsoft Related AllOther Interview Questions
Question
What is the difference between a Dataset and DataReader?
Can dataReader hold data from multiple tables?
 Question Submitted By :: Kiran
I also faced this Question!!     Rank Answer Posted By  
 
  Re: What is the difference between a Dataset and DataReader? Can dataReader hold data from multiple tables?
Answer
# 1
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 ?    10 Yes 3 No
Karna
 
  Re: What is the difference between a Dataset and DataReader? Can dataReader hold data from multiple tables?
Answer
# 2
DataSet is a disconnected object and holds the data from 
datastore. It can hold the data of more than one table.

   where as dataReader is connected architecture which can 
rbe used to read the data from the dataset in forward only 
fashion. DataReader cannot hold multiple tables of data.
 
Is This Answer Correct ?    1 Yes 0 No
Sandyni
 
 
 

 
 
 
Other ADO.NET Interview Questions
 
  Question Asked @ Answers
 
Explain different methods and Properties of DataReader which you have used in your project?  2
Explain what a diffgram is and its usage ?  1
What is Pooling? what is data pooling? what is sql pooling? TCS1
what is connection pooling ? Vertex3
Differences between dataset.clone and dataset.copy? Ksb2
Can you edit data in the Repeater control?  8
What is a datatable? SBI8
What are the steps in connecting to database ? Microsoft2
i making a project using windows application c#, i want to show user name, password, and one button login. i wanna make it with sealed class .how its possible . when i clicked my login button all project should be open. pls cleare me.  1
How to get oledb connection?  3
How to you declare connection strings and how to you make use of web.config ? MMTS2
can anybody show me the structure of ADO.NET  1
How can you implement sub data grid in a master datagrid?  1
What are the two fundamental objects in ADO.NET?  4
What are the three Objects of ADO.  8
Which are the different IsolationLevels ?  2
ADO and ADO.NET differences ? Microsoft2
Differnces between oracle 9i and sql server? Microsoft2
what purpose of Indexing creating? directly we can search the reqired row with the help of query?what is the use of indexing?  3
FetCh Records No 5 to 10 From Dataset  4
 
For more ADO.NET Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com