I would like to know which values are null in datatable in c# that is returned from ExecuteDataTable of SqlHelper class.
string select = "select * from testTable";
string val="";
DataTable dt=dbcon.ExecuteDataTable(select);
foreach (DataRow dr in dt.Rows)
{
foreach (DataColumn dc in dt.Columns )
{
if(dr[dc].Equals (null))
{
val ="null";
}
else
{
val = dr[dc].ToString();
}
}
}
But unfortunately I didn't find any way to do it. Please let me know if there is a way. Thank you in advance.