asp.net.ph

DataTableCollection.CanRemove Method ( DataTable )

System.Data Namespace   DataTableCollection Class


Checks whether a specified table can be removed from the collection.

[ VB ]
Overloads Public Function CanRemove ( _
   ByVal table As DataTable _
) As Boolean

[ C# ]
public bool CanRemove (
   DataTable table
);

[ C++ ]
public: bool CanRemove (
   DataTable* table
);

[ JScript ]
public function CanRemove (
   table : DataTable
) : Boolean;

Parameters

table
The DataTable object to check.

Return Value

true if the table can be removed; otherwise, false.

Example

The following example uses the CanRemove method to test whether each table can be removed from a DataSet. If so, the Remove method is called.

private void RemoveTables ( DataSet ds ) {
   // get the DataTableCollection.
   DataTableCollection myTables = ds.Tables;
   DataTable tbl;
   while ( myTables.Count > 0 ) {
      tbl = myTables [ 0 ];
      if ( myTables.CanRemove ( tbl ) ) myTables.Remove ( tbl );
   }
}
  C# VB

See Also

DataTableCollection Members   Clear   Remove   RemoveAt 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