C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » Visual Studio »

Datareader and dataadapter


Posted Date: 27 Jun 2009      Posted By: R.Jaya kumar (JK)      Member Level: Diamond     Points: 1   Responses: 5



hi

give example and explain advantages of DataReader and Dataadapter

thanks
kumar


Thanks and Regards
Jayakumar

Do not forget to Rate the post...





Responses

Author: ABitSmart    27 Jun 2009Member Level: DiamondRating: 2 out of 52 out of 5     Points: 2

DataReader is for connected architecture. DataAdapter is used for Disconnected architecture.
By that I mean, in case of DataReader the connection to the databse is always maintained and you will always have latest data. Disadvantage is the connection has to be maintained always.
In case of DataAdapater, the data is cached in your application. You do the changes and then update the database once for all. You do not have to maintain the connection. The disadvantage is that you data might be stale.

Kind regards,
ABitSmart
DNS Web-master, DNS MVM
My blog
Thoughts.exe



Author: Miss Meetu Choudhary    27 Jun 2009Member Level: DiamondRating: 2 out of 52 out of 5     Points: 2

We have two kinds of database connectivity architecture
1. Connected and
2. Disconnected

In connected architecture the connection to the database is always maintained i.e. all the changes are applied to the database and the data is directly fetched from the database through a busy communication for this we use DataReader

And for Disconnected architecture we use DataSet which will be maintained in the local memory as and when needed the changes are then restored to the database to fill these datasets we use DataAdapters.

Thanks and Regards
Miss Meetu Choudhary (Site Coordinator)
Go Green Save Green
My Profile on Google



Author: Viji RAJKUMAR    27 Jun 2009Member Level: DiamondRating: 2 out of 52 out of 5     Points: 2

Hi,

DateReader is an forward only and read only cursor type if you are accessing data through DataRead it shows the data on the web form/control but you can not perform the paging feature on that record(because it's forward only type).

Reader is best fit to show the Data (where no need to work on data)

DataAdapter is not only connect with the Databse(through Command object) it provide four types of command (InsertCommand, UpdateCommand, DeleteCommand, SelectCommand), It supports to the disconnected Architecture of .NET show we can populate the records to the DataSet. where as Dataadapter is best fit to work on data.


DataReader is a storage object which dedicated for read only.

we can use SqlDataAdapter class for read and write data from and to database
Regards,

Viji rajkumar

Regards

VIJI RAJKUMAR
Pls rate my Answer if it was supportive
http://vijirajkumar.blogspot.com



Author: R.Jaya kumar (JK)    28 Jun 2009Member Level: DiamondRating: 2 out of 52 out of 5     Points: 2

hi

thanks for all
kumar

Thanks and Regards
Jayakumar

Do not forget to Rate the post...



Author: Abhay    29 Jun 2009Member Level: DiamondRating: 2 out of 52 out of 5     Points: 2

Data Reader read only forward only
It's connection oriented
should Explicitly close the connection

Data Adapter is disconnected
It's acts as a bridge between data set and database

Thanks and Regards,
Abhay



Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.


Next : Insert application
Previous : Stored procedure asp.net
Return to Discussion Forum
Post New Message
Category: Visual Studio

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use