嗨,我是新來的andriod.I創建一個表,並通過使用sql lite.Now我將需要改變值表,我需要改變vales我可以做到這一點pls張貼一些代碼。謝謝你提前。如何修改數據庫中的表值
0
A
回答
0
所以,你試過UPDATE?
0
您需要使用SQLiteDatabase.update方法。方法將返回受影響的行數。在你的情況下,它應該是單行。
public int update(int id, ContentValues values, SQLiteDatabase db){
String selection = ID_COLUMN_NAME + "=" + Integer.toString(id);
count = db.update(TABLE_NAME, values, selection, null);
return count;
}
http://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.html#update(java.lang.String,android.content.ContentValues,java.lang.String中,java.lang.String中[]
P.S.對不起,StackOverflow損壞的URL
相關問題
- 1. 如何修改值數據庫中
- 2. 修改數據庫值
- 3. 如何修改android中的數據庫
- 4. 無法修改數據庫中的值
- 5. 無法修改數據庫中的值
- 6. 如何修改列表中的數值
- 7. 根據有序列表中的更改修改數據庫表
- 8. 如何根據其他數據庫中的更改修改一個數據庫中的值?
- 9. 修改數據庫
- 10. 修改數據庫
- 11. 如何限制用戶修改mysql數據庫中的數據?
- 12. 通過AJAX修改數據庫值
- 13. 如何從數據庫獲取值並將修改後的值更新到cakephp中的數據庫?
- 14. 如何在我的數據庫表上修改此標識int?
- 15. 如何通過用戶界面修改數據庫值?
- 16. 如何修改此PHP查詢以添加數據庫值'timestamp'?
- 17. 修改數據表
- 18. 如何防止用戶更改數據庫表中的值/行?
- 19. 如何獲取Oracle數據庫中所有最後修改表的列表?
- 20. 如何修改從數據庫檢索數據的SQLite查詢
- 21. R-如何從數據框中檢查修改和未修改的值
- 22. 修改數據庫屬性
- 23. 安卓:修改數據庫
- 24. 不修改數據庫
- 25. 修改數據庫文件
- 26. mysql_insert_id不修改數據庫
- 27. Ember.js:如何修改RESTSerializer中的數據
- 28. 如何修改python中的EXIF數據
- 29. 如何修改javascript中的POST數據?
- 30. 如何修改fiddler中的json數據。
我需要它在Android的SQL精簡版,而不是在SQL – MaheshBabu 2010-10-11 08:36:40