System.Data Namespace DataSet Class
Copies the structure of the DataSet, including all DataTable schemas, relations, and constraints.
[ VB ]
Public Function Clone ( ) As DataSet
[ C# ]
public DataSet Clone ( );
[ C++ ]
public: DataSet* Clone ( );
[ JScript ]
public function Clone ( ) : DataSet;
A new DataSet with the same schema as the current DataSet, , but none of the data.
NOTE: If these classes have been subclassed, the clone will also be of the same subclasses.
The following example initializes a clone of a DataSet object's schema.
private void CloneDataSet ( DataSet myDataSet ) {
// initialize a dataset object for the clone.
DataSet cloneDataSet = myDataSet.Clone ( );
// ... code to work with the clone here ...
}
Private Sub CloneDataSet ( ByVal myDataSet As DataSet )
' initialize a dataset object for the clone.
Dim cloneDataSet As DataSet = myDataSet.Clone ( )
' ... code to work with the clone here ...
End Sub |
|
C# |
VB |
DataSet Members Copy