tags:

views:

70

answers:

1

Which one of these techniques is faster?

1)

DbDataAdapter dataAdapter = _factory.CreateDataAdapter();
dataAdapter.SelectCommand = _command;

dataSet = new DataSet();

dataAdapter.Fill(dataSet);

2)

DataTable dt = new DataTable();

IDataReader iDataReader= _command.ExecuteReader();

dt.Load(iDataReader);

iDataReader.Close();
+1  A: 

Have a look at these links

DataReaders, DataSets, and performance

and

DataAdapter.Fill preferable to DataReader?

As mentioned in the comments to your question. It would be best to test for the given situation at hand, there is never a one rule applies to all.

astander
I didn't know that the seniors are browsing this site at Sundays.
JMSA
Programming is not just work, is part of life. X-)
astander