Freigeben über


DataView-Konstruktor (DataTable)

Initialisiert eine neue Instanz der DataView-Klasse mit der angegebenen DataTable.

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

Syntax

'Declaration
Public Sub New ( _
    table As DataTable _
)
'Usage
Dim table As DataTable

Dim instance As New DataView(table)
public DataView (
    DataTable table
)
public:
DataView (
    DataTable^ table
)
public DataView (
    DataTable table
)
public function DataView (
    table : DataTable
)

Parameter

Beispiel

Im folgenden Beispiel wird eine neue DataView mit der angegebenen DataTable erstellt.

Private Sub MakeDataView()
    Dim view As DataView
    view = New DataView(DataSet1.Tables("Suppliers"))

    ' Bind a ComboBox control to the DataView.
    Combo1.DataSource = view
    Combo1.DisplayMember = "Suppliers.CompanyName"
End Sub
private void MakeDataView()
{
    DataView view = new DataView(DataSet1.Tables["Suppliers"]);

    // Bind a ComboBox control to the DataView.
    Combo1.DataSource = view;
    Combo1.DisplayMember = "Suppliers.CompanyName";
}

Plattformen

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile für Pocket PC, Windows Mobile für Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

Versionsinformationen

.NET Framework

Unterstützt in: 2.0, 1.1, 1.0

.NET Compact Framework

Unterstützt in: 2.0, 1.0

Siehe auch

Referenz

DataView-Klasse
DataView-Member
System.Data-Namespace