Knight Data Access Layer
Creating Tables
Basic Tasks C# > Creating Database Structure > Creating Tables

Below is an example of creating a database table.  The SQL is automatically generated for the specific database provider (SqliteProvider, SqlServerProvider etc.).  The same code can be used for different types of database providers.  

 

//Get the current instance of the helper

IDataHelper db = DataHelper.SessionFactory();

 

db.CreateTableFromClass<SalesPeople>();