How to Remove Rows from DataTable at specified index position?

 Posted by vishalneeraj-24503 on 12/17/2013 | Category: ADO.NET Interview questions | Views: 946 | Points: 40
Answer:

Use RemoveAt() method of DataTable'Rows property to remove records at specified position.

For Example:-
dt_employee.Rows.RemoveAt(0);

Here dt_emplyee is our DataTable object and 0 is our DataTable Row Index or Position.
So it will remove 1st records from Datatable as Datatable rows start from 0 index.


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response