Gets the DataTable for which this row has a schema.
[Visual Basic] Public ReadOnly Property Table As DataTable [C#] public DataTable Table {get;} [C++] public: __property DataTable* get_Table(); [JScript] public function get Table() : DataTable;
The DataTable to which this row belongs.
Note The row does not necessarily belong to the table's collection of rows. This occurs when the DataRow has been created but not added to the RowsCollection. If the RowState property returns DataRowState.Proposed, the row is not in the collection.
The following example uses the Table property to return a reference to the columns collection of the DataTable.
[Visual Basic]
Private Sub GetTable() Dim myRow As DataRow Dim tempTable as DataTable ' Use a DataGrid control's DataTable to create a new row. myRow = DataGrid1.DataSource.DataTable.NewRow ' Use the Table property to get the DataTable and then the columns. tempTable = myRow.Table End Sub
DataRow Class | DataRow Members | System.Data Namespace | ColumnsCollection | DataTable