mercredi 18 février 2015

execute SQL file, Android app

I'm a total beginner with Android applications and after looking for hours, cant find an answer. I've managed to setup an Sqlite database and am now trying to create a table and insert some data using an SQL file.


How do I go about this? Better suggestions?


Here is what I've been trying, no idea if I'm way off or not. At the moment when I run the app, it cant find the SQL file.



var db = new SQLiteConnection (dbPath);
output += "\nDatabase Created...";
SQLiteCommand command = new SQLiteCommand(db);
command.CommandText = System.IO.File.ReadAllText("champs.sql");
output += "\nTables Created...";
return output;

Aucun commentaire:

Enregistrer un commentaire