Knight Data Access Layer
Execute Non Query
Basic Tasks C# > Database Commands > Execute Non Query

Any SQL command can be run simply by passing in a SQL statement.

 

//Get the current instance of the helper

IDataHelper db = DataHelper.SessionFactory();

 

int affectedRecords = db.ExecuteNonQuery("DELETE FROM LOG WHERE LOG_DATE < '2012/06/06'");