Initializes a new instance of the TableSetting class.
[Visual Basic] Public Sub New( _ ByVal table As DataTable, _ ByVal sort As String, _ ByVal rowFilter As String, _ ByVal rowStateFilter As DataViewRowState _ ) [C#] public TableSetting( DataTable table, string sort, string rowFilter, DataViewRowState rowStateFilter ); [C++] public: TableSetting( DataTable* table, String* sort, String* rowFilter, DataViewRowState rowStateFilter ); [JScript] public function TableSetting( table : DataTable, sort : String, rowFilter : String, rowStateFilter : DataViewRowState );
See DataSetView for more details on using a TableSetting.
See Sort for details on creating the sort expression.
See RowFilter for details on creating the rowFilter expression.
The following example creates a DataSetView and adds two TableSetting objects to the TableSettingsCollection.
[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. 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
TableSetting Class | TableSetting Members | System.Data Namespace | Add | DataTable | Sort | DataViewRowState | RowFilter | TableSettingsCollection