Click to See Complete Forum and Search --> : DataSet and DataReader


sam25
June 18th, 2003, 08:01 PM
Hi ,
How do i choose b/w DataSet or DataReader???
I have set of tables related to each other. I don't need data from all tables at same time. I always need current data. I need to pass data to a component which is abstracted from database definition.

Thanks,
Sam

wolfofthenorth
June 23rd, 2003, 08:07 PM
The datareader is a forward only, readonly object. It will keep a connection open as long as it is open. It is a fast way to loop through records.

The dataset can be used like an in memory representation of the database. You can use DataViews to filter and sort records for presentation. You can also establish relationships with the dataRelation object. You can use the dataset with a data adapter to update the database. These objects can keep track of changes and original values. When updating the database these objects can help to resolve conflicts or concurrency issues.

You said you need current data. ADO .NET is disconnected by nature. You may have problems here.


Hope this helps. :D