Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Testing for Null values with a DataReader
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00948865
Message ID:
00948873
Views:
15
Bonnie,

Thank you for the reply! I thought I could do something like this, but if I try dr.Item[0] I get the following compile error:

System.Data.IDataReader does not contain a definition for Item

I have looked through the help files and a couple of books I have, but I can find the correct syntax.

Kind Regards,

Mat

>
>I haven't used a DataReader, but based on how stuff works with DataSets, I bet you probably have to do something like this:
>
>IDataReader dr = this.ExecReader(SelectCmd, out conn);
>while (dr.Read())
>{
>  if (dr.Item[0] != DBNull.Value)
>    MyString = dr.GetString(0);
>}
>
>Something like that anyway ... I'm not sure of the syntax and I haven't actually tried it, but see if something along these lines would work for you.
>
>~~Bonnie
>
Matthew Kennedy
Decision Support Technology Inc.

"I try to take one day at a time, but sometimes several days attack me all at once." ~ Ashleigh Brilliant

New Jersey Dot Net User Group
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform