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

Initializes a new instance of the DataSetView class.

Overload List

Initializes a new instance of the DataSetView class.

[Visual Basic] Overloads Public Sub New()
[C#] public DataSetView();
[C++] public: DataSetView();
[JScript] public function DataSetView();

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

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

Example [Visual Basic]

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

Note   This example shows how to use one of the overloaded version of the DataSetView constructor. For other examples that may be available, see the individual overload topics.

[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