Пример #1
0
 private void CreateLocalDb()
 {
     _path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "festi.sqlite");
     if (File.Exists(_path))
     {
         File.Delete(_path);
     }
     SQLiteConnection.CreateFile(_path);
 }
Пример #2
0
 static SQLiteTestSuite()
 {
     if (File.Exists(FileName))
     {
         File.Delete(FileName);
     }
     SqliteConnection.CreateFile(FileName);
     using (var connection = new SqliteConnection(ConnectionString))
     {
         connection.Open();
         connection.Execute(@"CREATE TABLE Stuff (TheId integer primary key autoincrement not null, Name nvarchar(100) not null, Created DateTime null) ");
         connection.Execute(@"CREATE TABLE People (Id integer primary key autoincrement not null, Name nvarchar(100) not null) ");
         connection.Execute(@"CREATE TABLE Users (Id integer primary key autoincrement not null, Name nvarchar(100) not null, Age int not null) ");
         connection.Execute(@"CREATE TABLE Automobiles (Id integer primary key autoincrement not null, Name nvarchar(100) not null) ");
         connection.Execute(@"CREATE TABLE Results (Id integer primary key autoincrement not null, Name nvarchar(100) not null, [Order] int not null) ");
         connection.Execute(@"CREATE TABLE ObjectX (ObjectXId nvarchar(100) not null, Name nvarchar(100) not null) ");
         connection.Execute(@"CREATE TABLE ObjectY (ObjectYId integer not null, Name nvarchar(100) not null) ");
     }
 }
Пример #3
0
 public static void CreateDatabase(string dbName)
 {
     SQLiteConnection.CreateFile(dbName);
 }
Пример #4
0
 /// <summary>
 /// Create a new SQLite database.
 /// </summary>
 /// <param name="location">File location to create database</param>
 public static void CreateDatabase(string location)
 {
     SQLiteDataConnection.CreateFile(location);
 }