• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Not able to Insert data in SQLite

 
Ranch Hand
Posts: 69
Netbeans IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ,

I have the following code ,but when the method insertLabel() is called from MainActivity ,Logcat throws an exception saying tabel labels has no column named name , eventhough i am creating the column ,please let me know if anything is missing :
 
udaya krishna
Ranch Hand
Posts: 69
Netbeans IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not able to figure out what is the problem here , I am creating a columns called 'name' right? I dont know why it is not able to insert data.
 
Bartender
Posts: 2270
20
Android Java ME Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Use an exception handler for the insertion code, and see if you are getting any exception.
 
udaya krishna
Ranch Hand
Posts: 69
Netbeans IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Swastik ,

Its throwing android.database.sqlite.SQLiteException : table labels has no column named nmes(code 1).Still unable to figure out why!!
 
udaya krishna
Ranch Hand
Posts: 69
Netbeans IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

udaya krishna wrote:Hi Swastik , actual error

Its throwing android.database.sqlite.SQLiteException : table labels has no column named names(code 1).Still unable to figure out why!!



And in getAllLables()
is always false when i run in debug mode , so
is never executed..

 
Bartender
Posts: 4179
22
IntelliJ IDE Python Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

udaya krishna wrote:Hi Swastik ,

Its throwing android.database.sqlite.SQLiteException : table labels has no column named nmes(code 1).Still unable to figure out why!!


Is that the exact error message, copy and pasted? Is the code you posted the exact code? Why is the column being used in the error message as nmes and not name like the constant in your code? Note that there are two differences: a missing a and an added s.

If both the code and the error message are correct, then un-install the app and try re-installing it. It could be that the application did not properly close at one point and was left in memory. You make changes but those changes may not be properly reflected in the app that runs. If you are using Eclipse to compile the code, it won't hurt to do a clean build as well - I have seen the build not finish completely but not provide errors either, allowing a bad mix of code to reach the phone which caused 'impossible' errors.
 
udaya krishna
Ranch Hand
Posts: 69
Netbeans IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Steve,

Sorry , the exception was a typo as i did not know how to copy and paste from Logcat, but the column names are indeed correct , and yes i have tried building it several times.still no luck
 
reply
    Bookmark Topic Watch Topic
  • New Topic