//Create A DataTable
DataTable dTable = new DataTable();
//Get the totla number of fields in the reader
int colCounter = reader.FieldCount;
int recordRead = 0 ;
for (int i = 0 ; i < colCounter ; i++)
{
dTable.Columns.Add(reader.GetName(i),reader.GetFieldType(i));
}
dTable.BeginLoadData();
object[] values = new object[colCounter];
while (reader.Read())
{
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.