How to do it
I have used below code.
C#
for (int i = 0; i < ds.Tables.Count; i++)
{
for (int j = 0; j < ds.Tables[i].Columns.Count; j++)
{
if (ds.Tables[i].Rows[7][j].ToString().Trim().Contains("Lead Time (WEEKS)"))
{
int y = j;
if (ds.Tables[i].Rows[7][y + 1].ToString().Trim() == "" || ds.Tables[i].Rows[7][y + 1].ToString().Trim() != "")
{ int y1 = y + 1;
ds.Tables[i].Columns.RemoveAt(y1);
}
}
}
}

Salman BegRank #284 · 8.8K reputationPosted Oct 31, 2016, 10:49 PM EDT
Manas MohapatraRank #182 · 13.2K reputationPosted Oct 31, 2016, 10:52 PM EDT
Ananth GRank #1,176 · 1.5K reputationPosted Nov 1, 2016, 12:50 AM EDT