N
___Newbie___
Hello,
Why can't a string handle null values? Do I really need to check with
IsDBNull() for null values?
e.g.
fieldName = reader.GetString(0);
if (!reader.IsDBNull(1))
{
fieldNationality = reader.GetString(1); // Exception here! for null
value
} else {
fieldNationality = "";
}
uxPersonList.Items.Add(fieldName + " " + fieldNationality);
Thanks.
Why can't a string handle null values? Do I really need to check with
IsDBNull() for null values?
e.g.
fieldName = reader.GetString(0);
if (!reader.IsDBNull(1))
{
fieldNationality = reader.GetString(1); // Exception here! for null
value
} else {
fieldNationality = "";
}
uxPersonList.Items.Add(fieldName + " " + fieldNationality);
Thanks.