System.Data Namespace DataView Class
Initializes a new instance of the DataView class.
1. Initializes a new instance of the DataView class.
2. Initializes a new instance of the DataView class with the specified DataTable.
3. Initializes a new instance of the DataView class with the specified DataTable, RowFilter, Sort, and DataViewRowState.
The following example initializes a new DataView with a given DataTable, RowFilter, Sort, and DataViewRowState.
NOTE: This example uses one of the overloaded versions of the DataView constructor. For other examples that may be available, see the individual overload topics.
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