
02-04-2012 07:38 AM
Using a datareader which is returning rows with counts and sums.....of course a sum could be a null data type....
I do know the 'field' name......and the field column ordinal number
Am I getting close with the // stuff? below?
while (reader.Read())
{
// Create an array big enough to hold the column values
object[] values = new object[reader.FieldCount];
// Get the column values into the array
reader.GetValues(values);
//if(!reader.IsDBNull(7))
//{
// use (string)reader[7]
//} else we need to return a '0'
// Add the array to the ArrayList
results.Add(new Sage.Platform.ComponentModel.ComponentView(propert
}
Thanks!
02-04-2012 09:10 AM
Solution:
// Get the column values into the array
reader.GetValues(values);
// Get rid of Null values in the datareader returned array:
if(reader.IsDBNull(6))
{
values[6] = "0";
}
if(reader.IsDBNull(7))
{
values[7] = "0";
}
if(reader.IsDBNull(8))
{
values[8] = "0";
}
// Add the array to the ArrayList
results.Add(new Sage.Platform.ComponentModel.ComponentView(propert