次の方法で共有


DataView コンストラクタ (DataTable, String, String, DataViewRowState)

指定した DataTableRowFilterSort、および DataViewRowState を使用して DataView クラスの新しいインスタンスを初期化します。

名前空間: System.Data
アセンブリ: System.Data (system.data.dll 内)

構文

'宣言
Public Sub New ( _
    table As DataTable, _
    RowFilter As String, _
    Sort As String, _
    RowState As DataViewRowState _
)
'使用
Dim table As DataTable
Dim RowFilter As String
Dim Sort As String
Dim RowState As DataViewRowState

Dim instance As New DataView(table, RowFilter, Sort, RowState)
public DataView (
    DataTable table,
    string RowFilter,
    string Sort,
    DataViewRowState RowState
)
public:
DataView (
    DataTable^ table, 
    String^ RowFilter, 
    String^ Sort, 
    DataViewRowState RowState
)
public DataView (
    DataTable table, 
    String RowFilter, 
    String Sort, 
    DataViewRowState RowState
)
public function DataView (
    table : DataTable, 
    RowFilter : String, 
    Sort : String, 
    RowState : DataViewRowState
)

パラメータ

  • RowFilter
    DataView に適用する RowFilter
  • Sort
    DataView に適用する Sort

使用例

指定した DataTable を使用して新しい DataView を作成する例を次に示します。

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
private void MakeDataView(DataSet dataSet)
{
    DataView view = new DataView(dataSet.Tables["Suppliers"], 
        "Country = 'UK'", "CompanyName", 
        DataViewRowState.CurrentRows);
    view.AllowEdit = true;
    view.AllowNew = true;
    view.AllowDelete = true;
}

プラットフォーム

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

開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。

バージョン情報

.NET Framework

サポート対象 : 2.0、1.1、1.0

.NET Compact Framework

サポート対象 : 2.0、1.0

参照

関連項目

DataView クラス
DataView メンバ
System.Data 名前空間