[Visual Basic] Private Sub GetClone(ByVal myDataTable As DataTable) ' Get a clone of the original DataTable. Dim cloneTable As DataTable cloneTable = myDataTable.Clone() ' Insert code to work with clone of the DataTable. End Sub [C#] private void GetClone(DataTable myDataTable){ // Get a clone of the original DataTable. DataTable cloneTable; cloneTable = myDataTable.Clone(); // Insert code to work with clone of the DataTable. }>2) Can a data table be 'zapped'? I realize I can delete every row, but was curious if there was a simple erase method to reset a data table to zero rows.
[Visual Basic] Private Sub ClearTable(ByVal myTable As DataTable) Dim rc As DataRowCollection rc = myTable.Rows ' Clear all rows. rc.Clear End Sub [C#] private void ClearTable(DataTable myTable){ DataRowCollection rc; rc = myTable.Rows; // Clear all rows. rc.Clear(); }>