I couldn't use attach DATABASE in ANDROID -


insert 1 database table database table in android [duplicate]

how can use insert into/select 1 database table database table. more explanation have 1 data base "userdb" name , "usertble" table , another-one "worddb" name , "wordstble" table name.

 public class profiledbhelper extends sqliteopenhelper {

private sqlitedatabase pdb; public profiledbhelper(context context) { super(context, dbname, null, 1); } @override public void oncreate(sqlitedatabase db) { } @override public void onupgrade(sqlitedatabase db, int oldversion, int newversion) { } public void createprofiledb(string user) { tblname = user + "tbl"; string createtbl = "create table if not exists " + tblname + " (" + id + " integer primary key autoincrement, " + wordid + " integer not null, " + book + " text not null, " + lesson + " text not null, " + question + " text not null, " + answer + " text not null, " + accent + " text, " + option1 + " text, " + option2 + " text, " + option3 + " text, " + option4 + " text, " + option5 + " text, " + trueoption + " integer, " + englishsen1 + " text, " + englishsen2 + " text, " + englishsen3 + " text, " + persiansen1 + " text, " + persiansen2 + " text, " + persiansen3 + " text, " + firstshow + " text, " + noofshow + " integer, " + stepno + " integer, " + trueno + " integer, " + wrongno + " integer, " + nextshow + " text);"; pdb = this.getwritabledatabase(); pdb.execsql(createtbl); pdb.execsql("attach database ? wordb", new string[]{"/data/data/com.etudedevelopres.etude/databases/worddb"}); }

could please me. problem caused many headaches me. searched , @ around around 30 similar questions, nut non of couldn't me , know understanding problem.


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -