DataSet Constructor (String)
.NET Framework 2.0
Initializes a new instance of a DataSet class with the given name.
Namespace: System.Data
Assembly: System.Data (in system.data.dll)
Assembly: System.Data (in system.data.dll)
The following example creates a new DataSet, to which two DataTable objects are added.
Private Sub CreateDataSet() Dim dataSet As DataSet = New DataSet("aNewDataSet") ' Create two DataTable objects using a function. Dim table1 As DataTable = MakeTable("idTable1", "thing1") Dim table2 As DataTable = MakeTable("idTable2", "thing2") dataSet.Tables.Add(table1) dataSet.Tables.Add(table2) Console.WriteLine(dataSet.DataSetName, dataSet.Tables.Count) End Sub Private Function MakeTable(c1Name As String, c2Name As String) _ As DataTable Dim table As New DataTable ' Add two DataColumns Dim column As DataColumn = New DataColumn( _ c1Name, System.Type.GetType("System.Integer")) table.Columns.Add(column) column = New DataColumn(c2Name, _ System.Type.GetType("System.String")) MakeTable = table End Function
Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.
Community Additions
ADD
Show: