System.Data Namespace DataTable Class
Clones the structure of the DataTable, including all DataTable schemas, relations, and constraints.
[ VB ]
Public Function Clone ( ) As DataTable
[ C# ]
public DataTable Clone ( );
[ C++ ]
public: DataTable* Clone ( );
[ JScript ]
public function Clone ( ) : DataTable;
A new DataTable with the same schema as the current DataTable.
NOTE: If these classes have been subclassed, the clone will also be of the same subclasses.
The following example initializes a clone of a DataTable object's schema.
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.
}
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# |
VB |
DataTable Members