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
Help coderanch get a
new server
by contributing to the
fundraiser
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
Paul Clapham
Devaka Cooray
Liutauras Vilda
Sheriffs:
Jeanne Boyarsky
paul wheaton
Henry Wong
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Tim Moores
Carey Brown
Mikalai Zaikin
Bartenders:
Lou Hamers
Piet Souris
Frits Walraven
Forum:
Android
update doesn't work properly
shawn peter
Ranch Hand
Posts: 1325
1
posted 11 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
this is my update methd
public boolean updateTitle(SimDetails contact) { ContentValues args = new ContentValues(); SQLiteDatabase db = this.getWritableDatabase(); //args.put(KEY_SIM_NO, contact.get_serial_number()); //args.put(KEY_NAME, contact.get_name()); args.put(KEY_SIM_TYPE, contact.get_sim_type()); return db.update(TABLE_SIM, args, KEY_SIM_NO + "=" + contact.get_serial_number(), null) > 0; }
I need to change the type in the update method.but it doesn't change the type.There is no any exceptions.below it getcontatc method.when i get the type after updating it shows old type.
public SimDetails getContact(String id) { SimDetails product = new SimDetails(); try { String query = "Select * FROM " + TABLE_SIM + " WHERE " + KEY_SIM_NO + " = \"" + id + "\""; SQLiteDatabase db = this.getReadableDatabase(); Cursor cursor = db.rawQuery(query, null); if (cursor.moveToFirst()) { cursor.moveToFirst(); product.set_name((cursor.getString(0))); product.set_serial_number((cursor.getString(1))); product.set_sim_type((cursor.getString(2))); cursor.close(); } else { } } catch (Exception e) { e.printStackTrace(); } return product; }
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
put in LIST Sample Data to debug, also how view SQLITE DB Data from Eclipse IDE for debug purposes
I have problems: below are correct[DataManipulator.java]
it doesn't delete after i called delete method
Not able to Insert data in SQLite
why it doesn't create data base table
More...