Knight Data Access Layer
Truncating Tables
Basic Tasks C# > Deleting Data > Truncating Tables

Truncating a table will delete all records in a table.

 

//Get the current instance of the helper

IDataHelper db = DataHelper.SessionFactory();

 

db.TruncateTable("Customers");

 

or

 

db.TruncateTable<Customer>();