How to clear the dataset rows based on the column headings in c#

Suppose i have a dataset which contains a table having columns with headings like A,B,C
and i need to clear the all contents of B column only. How can i do that?

At present what i done is that, first i removed the column B

Dataset.Tables[0].Columns.Remove(B);

Then added back

Dataset.Tables[0].Columns.Add(B);

But the column index will changed if do the above method.Is there any other efficient way to do the same …?


Source: .net

Leave a Reply