Mono.Data.Sqlite.SqliteConnection.CreateFile C# (CSharp) Method

CreateFile() static public method

Creates a database file. This just creates a zero-byte file which SQLite will turn into a database when the file is opened properly.
static public CreateFile ( string databaseFileName ) : void
databaseFileName string The file to create
return void
    static public void CreateFile(string databaseFileName)
    {
      FileStream fs = File.Create(databaseFileName);
      fs.Close();
    }

Usage Example

Ejemplo n.º 1
0
 public static void Create(string dbpath, params string[] sql)
 {
     if (!File.Exists(dbpath))
     {
         try{
             SQLiteConnection.CreateFile(dbpath);
             Command(dbpath, sql);
         }
         catch (Exception) {
         }
     }
     // CREATE TABLE wins(id INTEGER PRIMARY KEY AUTOINCREMENT,[IDCardNo] VARCHAR (50),endtime TimeStamp NOT NULL DEFAULT CURRENT_TIMESTAMP);
 }