[android-developers] Table not present in the DATABASE_TABLE

2011-09-22 Thread sam
Hi Guys,

I'm having a problem with adding a column in adding it to the table.

@Override
public void onCreate(SQLiteDatabase db) {
// TODO Auto-generated method stub
db.execSQL(CREATE TABLE  + DataBase_Table +  ( + 
KEY_ID + 
INTEGER PRIMARY KEY AUTOINCREMENT,  +
Key_Name +  TEXT NOT NULL,  + Key_Age 
+  TEXT NOT NULL,  +
Key_Location +  TEXT NOT NUll);
);



}
Am i going wrong somwere in adding the Column to the table .

When i run ma application , see the logcat .


09-22 16:43:09.940: INFO/Database(389): sqlite returned: error code =
1, msg = table students has no column named Location
09-22 16:43:10.030: ERROR/Database(389): Error inserting Name=sai
Location=sa Age=11
09-22 16:43:10.030: ERROR/Database(389):
android.database.sqlite.SQLiteException: table students has no column
named Location: , while compiling: INSERT INTO students(Name,
Location, Age) VALUES(?, ?, ?);
09-22 16:43:10.030: ERROR/Database(389): at
android.database.sqlite.SQLiteCompiledSql.native_compile(Native
Method)
09-22 16:43:10.030: ERROR/Database(389): at
android.database.sqlite.SQLiteCompiledSql.compile(SQLiteCompiledSql.java:
91)
09-22 16:43:10.030: ERROR/Database(389): at
android.database.sqlite.SQLiteCompiledSql.init(SQLiteCompiledSql.java:
64)
09-22 16:43:10.030: ERROR/Database(389): at
android.database.sqlite.SQLiteProgram.init(SQLiteProgram.java:80)
09-22 16:43:10.030: ERROR/Database(389): at
android.database.sqlite.SQLiteStatement.init(SQLiteStatement.java:
36)
09-22 16:43:10.030: ERROR/Database(389): at
android.database.sqlite.SQLiteDatabase.compileStatement(SQLiteDatabase.java:
1145)
09-22 16:43:10.030: ERROR/Database(389): at
android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:
1536)
09-22 16:43:10.030: ERROR/Database(389): at
android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:
1410)
09-22 16:43:10.030: ERROR/Database(389): at
com.sai.saqlite.AndroidDataBase.createEntry(AndroidDataBase.java:76)
09-22 16:43:10.030: ERROR/Database(389): at
com.sai.saqlite.SQLDatabaseActivity.onClick(SQLDatabaseActivity.java:
55)
09-22 16:43:10.030: ERROR/Database(389): at
android.view.View.performClick(View.java:2408)
09-22 16:43:10.030: ERROR/Database(389): at android.view.View
$PerformClick.run(View.java:8816)
09-22 16:43:10.030: ERROR/Database(389): at
android.os.Handler.handleCallback(Handler.java:587)
09-22 16:43:10.030: ERROR/Database(389): at
android.os.Handler.dispatchMessage(Handler.java:92)
09-22 16:43:10.030: ERROR/Database(389): at
android.os.Looper.loop(Looper.java:123)
09-22 16:43:10.030: ERROR/Database(389): at
android.app.ActivityThread.main(ActivityThread.java:4627)
09-22 16:43:10.030: ERROR/Database(389): at
java.lang.reflect.Method.invokeNative(Native Method)
09-22 16:43:10.030: ERROR/Database(389): at
java.lang.reflect.Method.invoke(Method.java:521)
09-22 16:43:10.030: ERROR/Database(389): at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:868)
09-22 16:43:10.030: ERROR/Database(389): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
09-22 16:43:10.030: ERROR/Database(389): at
dalvik.system.NativeStart.main(Native Method)

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Table not present in the DATABASE_TABLE

2011-09-22 Thread TreKing
On Thu, Sep 22, 2011 at 7:07 AM, sam hotdude...@gmail.com wrote:

 Am i going wrong somwere in adding the Column to the table .


Have you tried reading the LogCat message you included in your post?

-
TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en