asp.net.ph

DataRowCollection.Clear Method

System.Data Namespace   DataRowCollection Class


Clears the collection of all rows.

[ VB ]
Public Sub Clear ( )

[ C# ]
void Clear ( );

[ C++ ]
public: void Clear ( );

[ JScript ]
public function Clear ( );

Exceptions


Exception Type Condition
InvalidConstraintException Occurs when a ForeignKeyConstraint is enforced on the DataRowCollection.

Remarks

Use this method to remove all DataRow objects from the Rows collection of a specified table.

This method resets the Rows.Count property to 0.

Example

The following example clears a DataRowCollection of all items.

private void ClearTable ( DataTable myTable ) {
   DataRowCollection myRows = myTable.Rows;
   ' clear all rows.
   myRows.Clear ( );
}
  C# VB

See Also

DataRowCollection Members   Add   Remove 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