My question is "why remove the table in the first place". If you just call the Fill method of a DataAdapter and pass a DataSet and a table name then it will populate a DataTable with that name, creating it if it doesn't exist. If you want to get rid of existing data then just clear the contents of the table:VB Code:
If myDataSet.Tables.Contains("TableName") Then 'Remove any existing data. myDataSet.Tables("TableName").Clear() End If 'Populate the specified table, creating if required. myDataAdapter.Fill(myDataSet, "TableName")




Reply With Quote