#region Function to remove -ve values from Datatable:
private DataTable RemoveNegativeValue(DataTable dtData)
{
DataTable dtTablewithNull = new DataTable();
if (dtData != null && dtData.Rows.Count > 0)
{
dtTablewithNull = dtData.Copy();
for (int i = 1; i < dtData.Columns.Count; i++)
{
for (int j = 0; j < dtData.Rows.Count; j++)
{
double dData = 0.0;
double.TryParse(dtData.Rows[j][i].ToString(), out dData);
if (dData.Equals(-999))
{
dtTablewithNull.Rows[j][i] = DBNull.Value;
}
else
{
dtTablewithNull.Rows[j][i] = dtData.Rows[j][i];
}
}
}
}
return dtTablewithNull;
}
#endregion
private DataTable RemoveNegativeValue(DataTable dtData)
{
DataTable dtTablewithNull = new DataTable();
if (dtData != null && dtData.Rows.Count > 0)
{
dtTablewithNull = dtData.Copy();
for (int i = 1; i < dtData.Columns.Count; i++)
{
for (int j = 0; j < dtData.Rows.Count; j++)
{
double dData = 0.0;
double.TryParse(dtData.Rows[j][i].ToString(), out dData);
if (dData.Equals(-999))
{
dtTablewithNull.Rows[j][i] = DBNull.Value;
}
else
{
dtTablewithNull.Rows[j][i] = dtData.Rows[j][i];
}
}
}
}
return dtTablewithNull;
}
#endregion