0

In a mono project I want to create a database and use that, and Sqlite-Net is optimzied for mono so would go with that. But I cant find any documentation how to create a database with it. So I just try to connect to it and hope it will say "Database dont exists, I will create one" but I get an exception so that approch dont work

readonly string _pathToDatabase = "Meter_db.db3";
public InstallMeterRepository()
{
    if(!File.Exists(_pathToDatabase))
    {                
        using (var conn = new SQLite.SQLiteConnection(_pathToDatabase))
        {                   
            conn.CreateTable<InstalledMeter>();
        }
    }
}
0

1 Answer 1

2

If you want to create a new database, you need the driver: http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki

You can check here too: http:// sqlite.phxsoftware.com/

And with this FREEWARE manager, you can do whatever you want with your database: (Recomended!) SQLite2009 Pro Enterprise Manager http://osenxpsuite.net/?xp=3&uid=managementtools

Happy develop!

Fear

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.