Copies the structure of the DataSet, including all DataTable schemas, relations, and constraints. Does not copy any data.
[Visual Basic] Public Overridable Function Clone() As DataSet [C#] public virtual DataSet Clone(); [C++] public: virtual 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.
[Visual Basic, C#] The following example creates a clone of a DataSet object's schema.
[Visual Basic] Private Sub GetClone(ByVal myDataSet As DataSet) ' Get a clone of the original DataSet. Dim cloneSet As DataSet cloneSet = myDataSet.Clone() ' Insert code to work with clone of the DataSet. End Sub [C#] private void GetClone(DataSet myDataSet){ // Get a clone of the original DataSet. DataSet cloneSet; cloneSet = myDataSet.Clone(); // Insert code to work with clone of the DataSet. }
[C++, JScript] No example is available for C++ or JScript. To view a Visual Basic or C# example, click the Language Filter button
in the upper-left corner of the page.
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework - Windows CE .NET
DataSet Class | DataSet Members | System.Data Namespace | Copy