Dealy

Dealy

  • NA
  • 213
  • 0

Error message: "Data is null.This method or property cannot be called on Null Values."

Oct 7 2009 8:41 AM
Hello,

I have the following code:
String name;
 
if (rdr.GetString(rdr.GetOrdinal("NAME")) == null)
    name = "";
 else
    name = rdr.GetString(rdr.GetOrdinal("NAME"));

                           

and i'm getting an error message "Data is null.This method or property cannot be called on Null Values."

Any ideas why i'm getting this error message?

Thank you in advance.

Answers (4)