7.8 Cloning the Schema of the Table

The Clone( ) method creates a new DataTable with the same schema as the original, but it contains none of the data in the original DataTable . The following example uses the Clone( ) method to create a new DataTable :

 // create a DataTable object variable to receive the clone DataTable cloneDt; cloneDt = dt.Clone(); 

ADO. NET in a Nutshell
ADO.NET in a Nutshell
ISBN: 0596003617
EAN: 2147483647
Year: 2005
Pages: 415

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net