If a variable comes from the sql database with a NULL value, its not the same as checking the c# variable for =”null” . You need a special line of code:
if (!DBNull.Value.Equals(MyDbVar))
If a variable comes from the sql database with a NULL value, its not the same as checking the c# variable for =”null” . You need a special line of code:
if (!DBNull.Value.Equals(MyDbVar))