Remove rows from datatable.
Hi..I want to remove rows from my datatable based on index values. For example from row 5 to row 10.But not by using for or foreach loop.
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.
Hemant SrivastavaPosted Jan 13, 2014, 3:59 PM
http://www.c-sharpcorner.com/UploadFile/0f68f2/querying-a-data-table-using-select-method-and-lambda-express/
Then Use Remove(DataRow row) method to remove them.
Dhirendra MisraPosted Jan 13, 2014, 3:13 AM
You can add one column to your datatable which is unique / index or make use of any existing column which can help you to filter your the required records.
You can use DataView RowFilter to perform this.
Refer:
http://www.csharp-examples.net/dataview-rowfilter/
http://www.c-sharpcorner.com/UploadFile/jgodel/DataSetsOverview0611302005002923AM/DataSetsOverview06.aspx