DataView Constructor (DataTable, String, String, DataViewRowState)

 

Initializes a new instance of the DataView class with the specified DataTable, RowFilter, Sort, and DataViewRowState.

Namespace:   System.Data
Assembly:  System.Data (in System.Data.dll)

Public Sub New (
	table As DataTable,
	RowFilter As String,
	Sort As String,
	RowState As DataViewRowState
)

Parameters

table
Type: System.Data.DataTable

A DataTable to add to the DataView.

RowFilter
Type: System.String

A RowFilter to apply to the DataView.

Sort
Type: System.String

A Sort to apply to the DataView.

RowState
Type: System.Data.DataViewRowState

A DataViewRowState to apply to the DataView.

The following example creates a new DataView with the specified DataTable.

Private Sub MakeDataView(ByVal dataSet As DataSet)
    Dim view As New DataView(dataSet.Tables("Suppliers"), _
        "Country = 'UK'", "CompanyName", _
        DataViewRowState.CurrentRows)
    view.AllowEdit = True
    view.AllowNew = True
    view.AllowDelete = True
End Sub

.NET Framework
Available since 1.1
Return to top
Show: