how replace blank in place of zero for particular column in a datatable dt in asp.net
Loading
how replace blank in place of zero for particular column in a datatable dt in asp.net
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Vishal YelvePosted Dec 2, 2022, 12:09 PM
try this
Sandeep KumarPosted Dec 2, 2022, 11:35 AM
Where I have to change For Particular Column
dt = (dt.AsEnumerable().Select(delegate (DataRow r)
{
DataRow nr = dt.NewRow();
foreach (DataColumn item in dt.Columns)
{
nr.SetField(item.ColumnName, r[item.ColumnName].ToString() == "0" ? null : r[item.ColumnName]);
}
return nr;
})).CopyToDataTable();
Vishal YelvePosted Dec 2, 2022, 11:20 AM