System.Data Namespace DataSet Class
Copies both the structure and data for this DataSet.
[ VB ]
Public Function Copy ( ) As DataSet
[ C# ]
public DataSet Copy ( );
[ C++ ]
public: DataSet* Copy ( );
[ JScript ]
public function Copy ( ) : DataSet;
A new DataSet with the same structure ( table schemas, relations, and constraints ) and data as this DataSet.
NOTE: If these classes have been subclassed, the copy will also be of the same subclasses.
The following example uses the Copy method to create a copy of the original DataSet.
private void CopyDataSet ( DataSet myDataSet ) {
// initialize a dataset object for the copy.
DataSet copyDataSet = myDataSet.Copy ( );
// ... code to work with the copy here ...
}
Private Sub CopyDataSet ( ByVal myDataSet As DataSet )
' initialize a dataset object for the copy.
Dim copyDataSet As DataSet = myDataSet.Copy ( )
' ... code to work with the copy here ...
End Sub |
|
C# |
VB |
DataSet Members Clone