user366312
user366312

Reputation: 17008

Which DataSet creation technique is faster?

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();

Upvotes: 0

Views: 354

Answers (1)

Adriaan Stander
Adriaan Stander

Reputation: 166486

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.

Upvotes: 1

Related Questions