aspxtreme

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



Books and more ...


Suggested Reading

Need a break ?



Previous page Back to top Next page

Check out related books at Amazon

© 2000-2008 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 aspxtreme