Wednesday, December 27, 2006

using a dataset versus using a datareader

DataSet:
1. used to retreive data in a disconnected manner.
2. can be serialized and transported to another system (using xml)
3. extremely flexible for manipulating data.

DataReader:
1. used to retreive data in a connected manner, until closed.
2. cannot be serilized, and is used only for read scenarios.

Internal functionning of the dataset:
1. it uses a DataReader to retreive its data, and then disconnect.
2. its structure is persisted in memory or using xml.

in this case, it is useless to use the dataset, in order to fill another structure such as a generic list System.Collections.generic.List, System.Collections.generic.List(Of T).

It is better to use a datareader to fill a generic list.

for more information on this:
perfomance check list for ado.net
http://msdn2.microsoft.com/en-us/library/ms998589.aspx
Imporving ADO.NET performance
http://msdn2.microsoft.com/en-us/library/ms998569.aspx



very useful information.
comments welcome,
happy programming!

3 comments:

Anonymous said...

I want to knw abt "checking coding standards...of c and c++ using .net(c#)

oudinia said...

http://msdn2.microsoft.com/en-us/visualc/default.aspx
this is the best I can do

oudinia said...

it's the link towards C++ learning center (msdn). I think that should give you plenty of resources, unless you are already familiar with this website.

Best Regards