I will answer my own question :
A method that will give similar performance as using SqlDataReader
is to use DataTable.LoadDataRow(object[] values, bool fAcceptChanges)
method. This is the method used internally when a DataTable
is populated using Fill()
method.
It's fast because it fill DataRow
data by accessing some internal fields directly, while using DataRow indexer (eg: dr[i] = value)
will do several times some internal checks.
As Lorentz suggested, using ItemArray
is faster than indexer but it is still slower than using LoadDataRow()
.