Gets or sets the source DataTable.
[Visual Basic] Public Property Table As DataTable [C#] public DataTable Table {get; set;} [C++] public: __property DataTable* get_Table(); public: __property void set_Table(DataTable*); [JScript] public function get Table() : DataTable; public function set Table(DataTable);
A DataTable that provides the data for this view.
The DataTable also has a DefaultView property which returns the default DataView for the table. For example, if you wish to create a custom view on the table, set the RowFilter on the DataView returned by the DefaultView.
The following example gets the DataTable of the current DataView.
[Visual Basic]
Private Sub GetDataTableFromDataView() ' Get the DataTable from the DataView bound to a DataGrid. Dim dv As DataView dv = CType(DataGrid1.DataSource, DataView) Dim t As DataTable t = dv.Table Dim r As DataRow Dim c As DataColumn For Each r in t.Rows For Each c in t.Columns Console.WriteLine(r(c)).ToString Next c Next r ENd Sub
DataView Class | DataView Members | System.Data Namespace | DataTable