asp.net.ph

DataTableCollection.Remove Method

System.Data Namespace   DataTableCollection Class


Removes a DataTable from the collection.

Overload List

1. Removes a specified DataTable from the collection.

2. Removes a DataTable object with the specified name from the collection.


Example

The following example uses the Contains and CanRemove methods to test whether a named table exists and can be removed. If so, the Remove method is called to remove the table.

NOTE: This example uses one of the overloaded versions of Remove. For other examples that may be available, see the individual overload topics.

private void RemoveTable ( DataSet ds, string tblName ) {
   DataTableCollection myTables = ds.Tables;
   // check if the named table exists.
   if ( myTables.Contains ( tblname ) ) && myTables.CanRemove ( tblName ) {
      myTables.Remove ( tblName );
   }
}
  C# VB

See Also

DataTableCollection Members Skip Navigation Links




Previous page Back to top Next page

Check out related books at Amazon

© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

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