What I'm trying to do is to create a table on the fly, when a connection is opened on an empty database. I've already created the model with Linq to Sqlite and successfully used it with non-empty databases.
Now I'm trying to work with "new" databases.
I do my db.Insert like this:
    using (MyDB db = MyDB("MyConnectionName"))
    {
            Person d = new Person()
            {
                name = "mimi"
            };
            db.Insert(d);
            myLabel.Content = db.Drivers.First().name;
        }
    }
An empty database is opened OK. Actually a 0KB file is created for it. But when I try to insert something into it (or of course read something) I get an exception: SQL logic error or missing database
The library I'm using:
https://github.com/linq2db/linq2db
The NuGet package:
http://nuget.org/packages/linq2db.SQLite/
 
     
     
    