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   To Refer this Site to Your Friends   Click Here
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
 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 ?    4 Yes 3 No
Karna
 

 
 
 
Other ADO.NET Interview Questions
 
  Question Asked @ Answers
 
How do you filter the data in datagrid? Choice-Solutions1
ADO and ADO.NET differences? Microsoft2
If we want to connect to many databases in dataaccess layer such as MSAccess,Sql server,oracle means not to a particular database depends on condition we have to connect to appropriate database in this scenario if we without changing code Ho wdo you handle this situation? Honeywell4
What is dataset and tell about its features. What are equivalent methods of previous, next etc. Of ADO in ADO.NET ? Digital-GlobalSoft1
What is reference by value how does it works in .net? SQL-Star1
How to Handle the exceptions in Sqlsrver2000 SQL-Star2
What?s the role of the DataReader class in ADO.NET connections? Ksb5
Being fresher How would i answer to the question that what is your salary exception?  3
Why sql Data Reader object not created Matrix2
What are advantages and disadvantages of Microsoft-provided data provider classes in ADO.NET?  1
What is a datatable? SBI3
How do u implement locking concept for dataset? ABC2
What is the use of parameter object? Ksb3
How to get oledb connection?  3
What are the attirbutes of DataSet? IBM4
I am fresh graduate, trained in C# .net. How do i answer when interview ask me , Where do you see yourself within 5 years from now?  2
what purpose of Indexing creating? directly we can search the reqired row with the help of query?what is the use of indexing?  3
What is ODP.NET ? TCS1
What is the key feature of ADO.NET compared to ADO ? TCS2
How to retrieve the third table value from the data set? Network-Solutions1
 
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