Cloning Data Tables
-
Is there an easy way to clone a DataTable? *->>Always working on my game, teach me *->>something new. cout << "dav1d\n";
DataRow[] sourceRows=sourceTable.Select(); DataTable targetTable=sourceTable.Clone(); foreach(DataRow sourceRow in sourceRows) targetTable.ImportRow(sourceRow); :) eperales
-
DataRow[] sourceRows=sourceTable.Select(); DataTable targetTable=sourceTable.Clone(); foreach(DataRow sourceRow in sourceRows) targetTable.ImportRow(sourceRow); :) eperales
-
what is s1ck about that is that I just clone the table without its rows; all I need is the schema. Thanks E. *->>Always working on my game, teach me *->>something new. cout << "dav1d\n";
DataSet ds; ds.Clone();
From MSDN: DataSet.Clone Method Copies the structure of the DataSet, including all DataTable schemas, relations, and constraints. Does not copy any data. [C#] [Serializable] public virtual DataSet Clone(); Return Value A new DataSet with the same schema as the current DataSet, but none of the data.