.NET Framework class library
DataTable.clone method
Cloning the structure of the DataSable, including all DataTable architecture and constraints.
[Visual Basic]
Public overridable function clone () AS DataTable
[C #]
Public Virtual DataTable Clone ();
[C ]
PUBLIC: Virtual DataTable * Clone ();
[Jscript]
PUBLIC FUNCTION Clone (): DataTable;
return value
New DataTable, with the same architecture as current DataTable.
Note
Note If these classes have been derived, the copy also has the same derived class.
Example
[Visual Basic, C #, C ] The following example creates a copy of the DataTable object architecture.
[Visual Basic]
Private sub getclone (byval mydataable as dataable)
'Get a clone of the original dataable.
Dim CloNetable As DataTable
Clonetable = myDataBLE.Clone ()
'Insert Code to Work with Clone of The DataTable.
End Sub
[C #]
Private void getclone (DATATABLE MyDataBole) {
// Get aclone of the Original DataTable.
DataTable CloNetable;
Clonetable = mydataable.clone ();
// INSERT CODE TO WORK WITH Clone of The DataTable.
}
[C ]
Private:
Void getclone (dataable * mydataable) {
// Get aclone of the Original DataTable.
DataTable * CloNetable;
Clonetable = mydataable-> clone ();
// INSERT CODE TO WORK WITH Clone of The DataTable.
}
[JScript] There is no example available for JScript. To view Visual Basic, C # or C examples, click the "Language Filter" button in the upper left corner.
Claim
Platform: Windows 98, Windows NT 4.0, Windows ME, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 Series, .NET Framework Lite
See
DataTable class | DataTable member | system.data namespace