asp.net.ph

DataTable.Clone Method

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;

Return Value

A new DataTable with the same schema as the current DataTable.

Remarks

NOTE: If these classes have been subclassed, the clone will also be of the same subclasses.

Example

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.
}
  C# VB

See Also

DataTable Members Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph