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!

DataSetView Constructor (DataSet)

Initializes a new instance of the DataSetView class using the specified DataSet.

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

Parameters

dataSet
The DataSet to be viewed/

Example [Visual Basic]

The following example creates a new DataSetView using a given DataSet.

[Visual Basic]

' The next two lines go into the Declarations section of the module:
Private myDataSetView As DataSetView
' SuppliersProducts is a class derived from DataSet.
Private myDataSet As SuppliersProducts 

Private Sub CreateDataSetView()
   ' Not shown: SuppliersProducts is already configured with tables, relations, constraints.
   Set myDataSet = New SuppliersProducts
   Set myDataSetView = New DataSetView(myDataSet)
End Sub

Private Sub AddTableSettings()
   ' Create TableSetting and add it to TableSettingsCollection.
   Dim ts As TableSetting
   Set ts = New TableSetting(myDataSet.Tables("Suppliers"), "CompanyName", _
   "CompanyName < Z" & Combo1.Text, DataRowState.ModifiedCurrent)
   myDataSetView.TableSettings.Add(ts)

   ' Create and add second TableSetting.
   Set ts = New TableSetting(myDataSet.Tables("Products"), "ProductName", _
   "Discontinued = 'True'", DataRowState.CurrentRows)
   myDataSetView.TableSettings.Add(ts)
End Sub

See Also

DataSetView Class | DataSetView Members | System.Data Namespace | DataSetView Constructor Overload List