SQLite CreateTable<> Database that already exists is replaced -


database exists replaced calling method createtable <> in sqlite windows 8, erasing lines , creating new table. how can solve? following code analyze:

using(var db = new sqlite.sqliteconnection(app.dbpath))         {              db.createtable<listasentid>();              if (db.executescalar<int>("select count(1) listasentid")==0)             {                 db.runintransaction(() =>                 {                     db.insert(new listasentid() { nome = "lista", eletros = "teste" });                 });              }         } 

not sure language using, if can execute raw sql can use following syntax:

create table if not exists listasentid (nome text, eletros text); 

this ensures table listasentid exists without nuking of previous data.


Comments

Popular posts from this blog

c# - SelectList with Dictionary, add values to the Dictionary after it's assigned to SelectList -

how can i manage url using .htaccess in php? -

ios - I get the error Property '...' not found on object of type '...' -