NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

DataSet Constructor (String)

Initializes a new instance of a DataSet class with the given name.

[Visual Basic]
Overloads Public Sub New( _
   ByVal dataSetName As String _
)
[C#]
public DataSet(
   string dataSetName
);
[C++]
public: DataSet(
   String* dataSetName
);
[JScript]
public function DataSet(
   dataSetName : String
);

Parameters

dataSetName
The name of the DataSet.

Example [Visual Basic]

The following example creates a new DataSet, to which is added two DataTable objects.

[Visual Basic]

Private Sub CreateDataSet()
   Dim ds As DataSet
   ds = New DataSet("aNewDataSet")
   ' Create two DataTable objects using a function.
   Dim t1 As DataTable = MakeTable("idTable1", "thing1")
   Dim t2 As DataTable = MakeTable("idTable2", "thing2")
   ds.Tables.Add(t1)
   ds.Tables.Add(t2)
   Console.WriteLine(ds.DataSetName, ds.Tables.Count)
End Sub


Private Function MakeTable(c1Name As String, c2Name As String) As DataTable
   Dim t As New DataTable
   Dim col As DataColumn
   ' Add two DataColumns
   col = New DataColumn(c1Name, System.Type.GetType("System.Integer"))
   t.Columns.Add col
   col = New DataCOlumn(c2Name, System.Type.GetType("System.String"))
   MakeTable = t
End Function

See Also

DataSet Class | DataSet Members | System.Data Namespace | DataSet Constructor Overload List | DataSetName | DataTable | TablesCollection