System.Data Namespace DataView Class
Initializes a new instance of the DataView class with the specified DataTable.
[ VB ]
Public Sub New ( _
ByVal table As DataTable _
)
[ C# ]
public DataView (
DataTable table
);
[ C++ ]
public: DataView (
DataTable* table
);
[ JScript ]
public function DataView (
table : DataTable
);
- table
- A DataTable to add to the DataView.
The following example initializes a new DataView with a given DataTable.
private void MakeDataView ( ) {
DataView dv = new DataView ( ds.Tables [ "Suppliers" ] );
// bind a ComboBox control to the DataView.
Combo1.DataSource = dv;
Combo1.DisplayMember = "Suppliers.CompanyName";
}
Private Sub MakeDataView ( )
Dim dv As New DataView ( ds.Tables ( "Suppliers" )
' bind a ComboBox control to the DataView.
Combo1.DataSource = dv
Combo1.DisplayMember = "Suppliers.CompanyName"
End Sub |
|
C# |
VB |
DataView Members DataView Constructor Overload List