I use the following query in my method
Cursor c = sqLiteDatabase.rawQuery("SELECT Content3 FROM " +
MYDATABASE_TABLE +
" where Content1 = '"+value1+"'", null);
But it throw Exception and app be force close. I pass the value1 to the method. Logcat as follows
09-21 17:14:21.242: ERROR/AndroidRuntime(16511): FATAL EXCEPTION: main
09-21 17:14:21.242: ERROR/AndroidRuntime(16511): android.database.sqlite.SQLiteException: no such column: Content3: , while compiling: SELECT Content3 FROM photodetails where Content1 = '2192012'
09-21 17:14:21.242: ERROR/AndroidRuntime(16511): at android.database.sqlite.SQLiteCompiledSql.native_compile(Native Method)
09-21 17:14:21.242: ERROR/AndroidRuntime(16511): at android.database.sqlite.SQLiteCompiledSql.compile(SQLiteCompiledSql.java:92)
09-21 17:14:21.242: ERROR/AndroidRuntime(16511): at android.database.sqlite.SQLiteCompiledSql.<init>(SQLiteCompiledSql.java:65)
09-21 17:14:21.242: ERROR/AndroidRuntime(16511): at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:83)
09-21 17:14:21.242: ERROR/AndroidRuntime(16511): at android.database.sqlite.SQLiteQuery.<init>(SQLiteQuery.java:49)
09-21 17:14:21.242: ERROR/AndroidRuntime(16511): at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:42)
09-21 17:14:21.242: ERROR/AndroidRuntime(16511): at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1356)
09-21 17:14:21.242: ERROR/AndroidRuntime(16511): at android.database.sqlite.SQLiteDatabase.rawQuery(SQLiteDatabase.java:1324)
09-21 17:14:21.242: ERROR/AndroidRuntime(16511): at roman10.tutorial.fileobserver.SQLiteAdapter.fetchresult(SQLiteAdapter.java:80)
09-21 17:14:21.242: ERROR/AndroidRuntime(16511): at roman10.tutorial.fileobserver.FileModificationMonitor$3.onClick(FileModificationMonitor.java:56)
09-21 17:14:21.242: ERROR/AndroidRuntime(16511): at android.view.View.performClick(View.java:2485)
09-21 17:14:21.242: ERROR/AndroidRuntime(16511): at android.view.View$PerformClick.run(View.java:9080)
09-21 17:14:21.242: ERROR/AndroidRuntime(16511): at android.os.Handler.handleCallback(Handler.java:587)
09-21 17:14:21.242: ERROR/AndroidRuntime(16511): at android.os.Handler.dispatchMessage(Handler.java:92)
09-21 17:14:21.242: ERROR/AndroidRuntime(16511): at android.os.Looper.loop(Looper.java:130)
09-21 17:14:21.242: ERROR/AndroidRuntime(16511): at android.app.ActivityThread.main(ActivityThread.java:3687)
09-21 17:14:21.242: ERROR/AndroidRuntime(16511): at java.lang.reflect.Method.invokeNative(Native Method)
09-21 17:14:21.242: ERROR/AndroidRuntime(16511): at java.lang.reflect.Method.invoke(Method.java:507)
09-21 17:14:21.242: ERROR/AndroidRuntime(16511): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
09-21 17:14:21.242: ERROR/AndroidRuntime(16511): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
09-21 17:14:21.242: ERROR/AndroidRuntime(16511): at dalvik.system.NativeStart.main(Native Method)
Please point out my mistake. Thanks
Finally i got solution for my issue.. Just delete the db in file explorer–>data/data/packagename/dbname. And run again. now it works fine.