Dataset uses SqlDataReader?....

ignohegewaria

New Member
This may be the wrong group to post. But what the heck. <BR>I keep reading that internally... the sqlDataAdapter uses the sqlDataReader to fill the contents of a dataset. This raises a bunch of questions in my mind.<BR><BR>#1. Does the dataadapter simply loop through each item in the datareader with a loop? Or does it use some special technique to read the data.. It only has the read() method so I cant figure out any other way except the dataadapter simply loops through each record one at a time and fills the dataset.<BR><BR>#2. (Pertains to question 1). When calling the fill method of the SqlDataAdapter with the StartRecord and maxrecords properties... Would the SqlDataAdapter simply use a loop and only fill the necessary records? <BR><BR>#3. Say I create a datareader.. then I use the DataAdapters fill method with the datareader property. Would this be the same performance wise as just calling the sql directly? I mean the dataadapter would just create a datareader the same way and then just loop through it.. When passing the datareader as a parameter to the fill method you are basically just saving it a step....<BR><BR>The main thing Im trying to figure out... perfomance wise... looping through all the results of a datareader with a while loop and storing it in some kind of collection is basically the same as what the dataadapters fill method does to the dataset... Maybe somebody can point me to an article or a better place to post these questions...
 
Back
Top