asp.net.ph

DataTable.DataSet Property

System.Data Namespace   DataTable Class


Returns the DataSet that this table belongs to.

Syntax


Script [ DataSet variable = ] DataTable.DataSet

Property Value


variable Returns the DataSet that this table belongs to.

The property is read only with no default value.

Remarks

If a control is data bound to a DataTable, and the table belongs to a DataSet, you can get to the DataSet through this property.

Example

The following example returns the parent DataSet of a given table through the DataSet property.

Private void GetDataSetFromTable ( ) {
   DataTable myTable;
   // get the DataTabe of a DataGrid.
   myTable = ( DataTable ) myDataGrid.DataSource;
   // get the DataSet of the DataTable.
   DataSet myDataSet = myTable.DataSet;
}
  C# VB

See Also

DataTable Members   DataSet 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