Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Android
Search Coderanch
Advance search
Google search
Register / Login
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
Ron McLeod
Tim Cooke
Paul Clapham
Liutauras Vilda
Sheriffs:
Junilu Lacar
Rob Spoor
Jeanne Boyarsky
Saloon Keepers:
Stephan van Hulst
Carey Brown
Tim Holloway
Piet Souris
Bartenders:
Forum:
Android
i am getting error while i try to add datas to this table
shawn peter
Ranch Hand
Posts: 1325
1
posted 9 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
this is my table creation code.
private static final String TABLE_SWAP = "shiftswap"; private static final String KEY_REQ_MEMBER = "reqmember"; private static final String KEY_RES_MEMBER = "resmember"; private static final String KEY_REQ_DATE = "reqdate"; private static final String KEY_RES_DATE = "resdate"; private static final String KEY_MEMBER_RESPONSE = "memberres"; private static final String KEY_PM_RESPONSE = "pmrespnse"; private static String global = ""; public DatabaseHandler(Context context) { super(context, DATABASE_NAME, null, DATABASE_VERSION); } // Creating Tables @Override public void onCreate(SQLiteDatabase db) { // TODO Auto-generated method stub try { String CREATE_SWAP_TABLE = "CREATE TABLE " + TABLE_SWAP + "(" + KEY_RES_MEMBER + " TEXT," + KEY_REQ_MEMBER + " TEXT PRIMARY KEY," + KEY_REQ_DATE + " TEXT" +KEY_RES_DATE + " TEXT" + KEY_MEMBER_RESPONSE + " TEXT" + KEY_PM_RESPONSE + " TEXT" +")"; db.execSQL(CREATE_SWAP_TABLE); } catch (Exception e) { e.printStackTrace(); } } this is insertion part [code=java] ContentValues values = new ContentValues(); values.put(KEY_RES_MEMBER, swapreq.getRes_member()); values.put(KEY_REQ_MEMBER, swapreq.getReq_member()); values.put(KEY_REQ_DATE, swapreq.getReq_date()); values.put(KEY_RES_DATE, swapreq.getRes_date()); db.insert(TABLE_SWAP, null, values); db.close(); // Closing database connection
below is error.that means it doesn't create the table.
10-02 09:24:08.180: I/Database(576): sqlite returned: error code = 1, msg = no such table: shiftswap 10-02 09:24:08.310: E/Database(576): Error inserting reqmember=Aruna resmember=Kasun reqdate=20 resdate=25
shawn peter
Ranch Hand
Posts: 1325
1
posted 9 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
i am still having issue.Why it doesn't create the table?
shawn peter
Ranch Hand
Posts: 1325
1
posted 9 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Its resolved now .I missed the , .
F is for finger. Can you stick your finger in your nose? Doesn't that feel nice? Now try this tiny ad:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Camera failed error
connecting to sqlite database
how to read table from mobile
need to change the image savinh path
Not able to Insert data in SQLite
More...