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




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