Dela via


Creating a DataSet (ADO.NET)

You create an instance of a DataSet by calling the DataSet constructor. Optionally specify a name argument. If you do not specify a name for the DataSet, the name is set to "NewDataSet".

You can also create a new DataSet based on an existing DataSet. The new DataSet can be an exact copy of the existing DataSet; a clone of the DataSet that copies the relational structure or schema but that does not contain any of the data from the existing DataSet; or a subset of the DataSet, containing only the modified rows from the existing DataSet using the GetChanges method. For more information, see Copying DataSet Contents (ADO.NET).

The following code example demonstrates how to construct an instance of a DataSet.

Dim customerOrders As DataSet = New DataSet("CustomerOrders")
DataSet customerOrders = new DataSet("CustomerOrders");

See Also

Concepts

Populating a DataSet from a DataAdapter (ADO.NET)

Other Resources

DataSets, DataTables, and DataViews (ADO.NET)

ADO.NET Managed Providers and DataSet Developer Center