System.Data Namespace DataView Class
Initializes a new instance of the DataView class with the specified DataTable, RowFilter, Sort, and DataViewRowState.
[ VB ]
Public Sub New ( _
ByVal table As DataTable _
ByVal RowFilter As String _
ByVal Sort As String _
ByVal RowState As DataViewRowState _
)
[ C# ]
public DataView (
DataTable table
string RowFilter
string Sort
DataViewRowState RowState
);
[ C++ ]
public: DataView (
DataTable* table
String RowFilter
String Sort
DataViewRowState RowState
);
[ JScript ]
public function DataView (
table : DataTable
RowFilter : String
Sort : String
RowState : DataViewRowState
);
- table
- A DataTable to add to the DataView.
- RowFilter
- A RowFilter to apply to the DataView.
- Sort
- A Sort to apply to the DataView.
- RowState
- A DataViewRowState to apply to the DataView.
The following example initializes a new DataView with a given DataTable, RowFilter, Sort, and DataViewRowState.
private void MakeDataView ( DataSet ds ) {
DataView dv = new DataView ( ds.Tables [ "Suppliers" ],
"Country = 'UK'", "CompanyName", DataViewRowState.CurrentRows );
dv.AllowEdit = true;
dv.AllowNew = true;
dv.AllowDelete = true;
}
Private Sub MakeDataView ( ds As DataSet )
Dim dv As New DataView ( ds.Tables ( "Suppliers" ), _
"Country = 'UK'", "CompanyName", DataViewRowState.CurrentRows )
dv.AllowEdit = True
dv.AllowNew = True
dv.AllowDelete = True
End Sub |
|
C# |
VB |
DataView Members DataView Constructor Overload List