Function to convert NULL Value to string.Empty

Rajni.Shekhar
Posted by Rajni.Shekhar under ASP.NET category on | Points: 40 | Views : 4508
 protected string convertNullValue(object obj)
{
if (obj == null || obj.Equals(DBNull.Value))
{
return string.Empty;
}
else
{
return obj.ToString().Trim();
}
}

Comments or Responses

Login to post response