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

share|improve this question

1 Answer

up vote 0 down vote accepted

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.

share|improve this answer

Your Answer

 
or
required, but never shown
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.