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!

TableSettingsCollection.Add

Adds a TableSetting to the collection.

Overload List

Creates and adds a TableSetting with the specified name, sort, filter, and row state filter to the collection.

[Visual Basic] Overloads Public Function Add(DataTable, String, String, DataViewRowState) As TableSetting
[C#] public TableSetting Add(DataTable, String, String, DataViewRowState);
[C++] public: TableSetting* Add(DataTable*, String, String, DataViewRowState);
[JScript] public function Add(DataTable, String, String, DataViewRowState) : TableSetting;

Adds the specified TableSetting to the collection.

[Visual Basic] Overloads Public Sub Add(TableSetting)
[C#] public void Add(TableSetting);
[C++] public: void Add(TableSetting*);
[JScript] public function Add(TableSetting);

Example

The following example creates a DataSetView and adds two TableSetting objects to the TableSettingsCollection.

Note   This example shows how to use one of the overloaded versions of Add. For other examples that may be available, see the individual overload topics.
' The next two lines go into the Declarations section of the module:
' 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.
   myDataSet = New SuppliersProducts
   myDataSetView = New DataSetView(myDataSet)
End Sub

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

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

See Also

TableSettingsCollection Class | TableSettingsCollection Members | System.Data Namespace