Wednesday, September 08, 2004

Conversion : datareader into array

private Object[] PopulateReportRecordFromSqlReader(IDataReader reader)
{
//Add One More for ID
int length = reader.FieldCount + 1;

Object[] data = new Object[length];

for(int i =0 ; i < length ; i++)
{
if(i==0)
{
data[0] = i;
}
else
{
data[i] = reader[i-1];
}
}
return data;
}

0 Comments:

Post a Comment

<< Home