asp.net.ph

DataView Constructor ( DataTable )

System.Data Namespace   DataView Class


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

[ VB ]
Public Sub New ( _
   ByVal table As DataTable _
   ByVal RowFilter As String _
   ByVal Sort As String _
   ByVal RowState As DataViewRowState _
)

[ C# ]
public DataView (
   DataTable table
   string RowFilter
   string Sort
   DataViewRowState RowState
);

[ C++ ]
public: DataView (
   DataTable* table
   String RowFilter
   String Sort
   DataViewRowState RowState
);

[ JScript ]
public function DataView (
   table : DataTable
   RowFilter : String
   Sort : String
   RowState : DataViewRowState
);

Parameters

table
A DataTable to add to the DataView.
RowFilter
A RowFilter to apply to the DataView.
Sort
A Sort to apply to the DataView.
RowState
A DataViewRowState to apply to the DataView.

Example

The following example initializes a new DataView with a given DataTable, RowFilter, Sort, and DataViewRowState.

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;
}
  C# VB

See Also

DataView Members   DataView Constructor Overload List Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph