MrKevorkian
asked on
check if a DataRow cell is null
i want to check if a datarow cell has anything in it.
if it is null - i will put a string.empty into it(i think this is best)
i am doing this so i can just populate a address object without worrying if it will break because the data cell is null.
my code which didnt work is:
//check address for nulls
if (dr["Postcode"] = null)
{
dr["Postcode"] = s;
}
if it is null - i will put a string.empty into it(i think this is best)
i am doing this so i can just populate a address object without worrying if it will break because the data cell is null.
my code which didnt work is:
//check address for nulls
if (dr["Postcode"] = null)
{
dr["Postcode"] = s;
}
plz give me more explanation
ASKER
i collect a dataset from the db.
i want a way of checking if its datarows contents contain any data or if they are null
if they are null then just assign a default empty string
i want a way of checking if its datarows contents contain any data or if they are null
if they are null then just assign a default empty string
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.