Datatable.Clear() method please help

  • Thread starter Thread starter cameljs18
  • Start date Start date
C

cameljs18

I have a datatable into which i insert data then display the data in a
datagridview.When i want to clear the table and place completely new
data in the table, the table still retains the column headers(this is
using the datatable.Clear() method).The table then adds the new
headers to the old which results in empty columns.Please inform me how
to clear the data completely.thanks
 
Datatable.Clear() methods clears only the data.

if you want to remove / clear all columns as well from it, use
DataTable.Columns.Clear() method.
 
I have a datatable into which i insert data then display the data in a
datagridview.When i want to clear the table and place completely new
data in the table, the table still retains the column headers(this is
using the datatable.Clear() method).The table then adds the new
headers to the old which results in empty columns.Please inform me how
to clear the data completely.thanks

thanks works fine now
 
Back
Top