Knight Data Access Layer
Truncating Table
Basic Tasks C# > Database Commands > Truncating Table

Truncating a table will delete all the records in a table.

 

//Get the current instance of the helper

IDataHelper db = DataHelper.SessionFactory();

 

db.TruncateTable<SalesPeople>();

 

OR

 

db.TruncateTable("Person");