Answer: We can clear both DataTable Rows and Columns by creating new Objects as well as with the help of Clear() method of Datatable Column/Rows property.
dt_employee.Columns.Clear(); //For clearing Columns
dt_employee.Rows.Clear(); //For clearing Rows
dt_employee = new DataTable(); //For clearing both Columns and Rows
Asked In: Many Interviews |
Alert Moderator