Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create new SQLite database on WinRT?

I want to create a new database from C# code in my WinRT app. I searched the Web and the way to do that appears to be the SQLiteConnection.CreateFile() method. However, that method does not exist in the SQLite namespace, at least in the WinRT version. I installed SQLite using the NuGet packge name "sqlite-net" and included the sqlite3.dll into my project. I do see properly methods like CreateTable(), Query(), etc. but not CreateFile(). Where is it? Or does the WinRT package use a different method for creating database files from code?

like image 549
Robert Oschler Avatar asked Jan 29 '14 18:01

Robert Oschler


People also ask

How do I create a database in SQLite GUI?

To create a new database using DB Browser, simply click New Database to create a database for your data, give the database an appropriate name, and put it in the folder that you're using for your work on the project. You are then able to import data, create tables or indices as required.

Can we create database in SQLite?

To create a new database in SQLite you need to specify databases when opening SQLite, or open an existing file using . open . You can use the . database command to see a list of existing databases.

How do I create a SQLite database in Windows?

SQLite CREATE Database In this SQLite tutorial, here is how you can create a new database: Open the Windows Command Line tool (cmd.exe) from the start, type “cmd” and open it. From the Installation and packages tutorial, you should now have created an SQLite folder in the “C” directory and copied the sqlite3.exe on it.

Is DB browser for SQLite good?

DB Browser for SQLite (DB4S) is a high quality, visual, open source tool to create, design, and edit database files compatible with SQLite.


1 Answers

var db = new SQLiteConnection(databasePath, SQLiteOpenFlags.Create | SQLiteOpenFlags.ReadWrite);

is how I did it.

like image 52
N_A Avatar answered Sep 30 '22 12:09

N_A