0

I have a question about SqlDataReader:

Is there some way to modificated the values in SqlDataReader? For example:

while (sdr.Read())
{
     double PRICE = double.Parse(sdr["PRICE"].ToString());
     if (PRICE == null) PRICE = Single.MinValue;
     .....
}

I would like that for each null value in my DataReader, assigned Single.MinValue to use after this modifications in another process

Xavi Guirao
  • 338
  • 4
  • 17

1 Answers1

0

I don't think you can modify SqlDataReader.
Source: MSDN - Contrasting the ADO.NET DataReader and DataSet

The DataReader has a defined set of operations that revolve around its connected, forward-only, read-only nature.

You may use DataSet to achieve what you want.

Habib
  • 219,104
  • 29
  • 407
  • 436