Hi, I had created a database and I am writing some values ino that
database as.

sampleDB.execSQL("INSERT INTO " +
                                SAMPLE_TABLE_NAME +
                                " Values ('s','m');");

Then here the values are added as s and m respectively.It is fine. But
now I don't want to use hard coded value like's' and 'm'. Now I have 2
String as.
String nm = "Pramod";
String add = "deore";

Now I want to add these 2 String to database. When I write code as
sampleDB.execSQL("INSERT INTO " +
                                SAMPLE_TABLE_NAME +
                                " Values (nm,add');");

Then I got error as -
10-18 15:15:14.464: ERROR/Database(21408): Failure 1 (no such column:
s) on 0x2fb288 when preparing 'INSERT INTO App Values (s,m);'.
10-18 15:15:14.473: ERROR/ShowSwitches(21408): Could not create or
Open the database.

How to add String to database?
Thanks

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to