// Create a DataSet Object DataSet originalDataSet = new DataSet("OriginalDataSet"); // Add a new DataTable to the DataSet DataTable dataTable = new DataTable("DataTable"); originalDataSet.Tables.Add(dataTable); // Create a copy of the DataSet and its structure DataSet copyDataSet = originalDataSet.Copy();
// Create a DataSet Object DataSet originalDataSet = new DataSet("OriginalDataSet"); // Add a new DataTable to the DataSet DataTable dataTable = new DataTable("DataTable"); originalDataSet.Tables.Add(dataTable); // Create a copy of the DataTable DataTable copyDataTable = dataTable.Copy();This example creates a new DataSet object called originalDataSet and adds a new DataTable object called dataTable to it. Then, it creates a copy of the DataTable object using the Copy method. The System.Data DataSet Copy method is part of the .NET Framework Class Library and is included in the System.Data.dll package library.