asp.net.ph

DataTable.Clear Method

System.Data Namespace   DataTable Class


Clears the DataTable of all data.

[ VB ]
Public Sub Clear ( )

[ C# ]
public void Clear ( );

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

[ JScript ]
public function Clear ( );

Remarks

All rows in all tables are removed. An exception is generated if the table has any enforced child relations that would cause child rows to be stranded.

Example

The following example clears the table of all data.

Private void ClearTable ( DataTable myTable ) {
   try {
      myTable.Clear ( );
  }
   catch ( DataException dataException ) {
      Response.Write ( dataException.ToString ( ) );
   }
}
  C# VB

See Also

DataTable 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