J
Jeff User
I want to convert each record read (with a datareader) to a string
array and then place each of those arrays into another array (sResult)
The problem here is that when the inner loop begins to process the 2nd
record read (from the outer loop) & for example: iRowCnt ==1), the
values in sResult[0] are updated to reflect the new values being
placed into sRow.
OK, so I take it that when storing sRow into sResult, I am storing a
reference to sRow. The question is, how do I store the actual values
from each individual row into sResult?
string[][] sResult = new String[30][];
string[] sRow = new String[20];
//loop thru data reader
while(LocalReader.Read())
{
cnt=0;
iReaderLength = LocalReader.FieldCount;
while (cnt < iReaderLength)
{
sRow[cnt] = LocalReader.GetValue(cnt).ToString();
cnt++;
}
sResult[iRowCnt]=sRow;
iRowCnt++;
}
Hope this is clear
Jeff
array and then place each of those arrays into another array (sResult)
The problem here is that when the inner loop begins to process the 2nd
record read (from the outer loop) & for example: iRowCnt ==1), the
values in sResult[0] are updated to reflect the new values being
placed into sRow.
OK, so I take it that when storing sRow into sResult, I am storing a
reference to sRow. The question is, how do I store the actual values
from each individual row into sResult?
string[][] sResult = new String[30][];
string[] sRow = new String[20];
//loop thru data reader
while(LocalReader.Read())
{
cnt=0;
iReaderLength = LocalReader.FieldCount;
while (cnt < iReaderLength)
{
sRow[cnt] = LocalReader.GetValue(cnt).ToString();
cnt++;
}
sResult[iRowCnt]=sRow;
iRowCnt++;
}
Hope this is clear
Jeff