Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8462807
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T14:16:26+00:00 2026-06-10T14:16:26+00:00

I have an insert entry logic into my android application which was responding perfectly

  • 0

I have an insert entry logic into my android application which was responding perfectly till last time I accessed the application.
But it suddenly started to stop responding and running. So please help me whats the error or mistake I have made in my logic or what else would be the problem in my coding which suddenly responded sqlite to behave in such a manner.
Please help me out as soon as possible as I have my final presentation of the android-application today and I am left out with very less time.

Thanks in advance for the help.

REGARDS 🙂

Following my Create Table Logic:

private static final int DATABASE_VERSION = 1; // db version
    private static final String DATABASE_NAME = "db_Blood_Donation"; // db name
    private static final String TABLE_NAME = "Table1"; // table name
    // table fields
    private static final String KEY_ID = "bid";
    private static final String KEY_NAME = "bname";
    private static final String KEY_DATE = "bdate";
    private static final String KEY_GRP = "bgroup";
    private static final String KEY_ADD = "baddress";
    private static final String KEY_PH = "bphno";

    public DBHelper(Context context) {
        super(context, DATABASE_NAME, null, DATABASE_VERSION);
        // TODO Auto-generated constructor stub
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        // TODO Auto-generated method stub
        /* ------------- CREATE TABLE ------------- */


        String CREATE_TABLE1 = "CREATE TABLE " + TABLE_NAME + "(" + KEY_ID
                + "INTEGER PRIMARY KEY, " + KEY_NAME + "TEXT, " + KEY_DATE
                + "TEXT, " + KEY_GRP + "TEXT, " + KEY_ADD + "TEXT, " + KEY_PH
                + "TEXT " + ")";

        db.execSQL(CREATE_TABLE1);
        Log.d("Table_Created", "table1");
    }

Following is my AddEntry Logic:

/* ----------------- ADD USER ------------- */

    void addUser(BDFieldClass user) {
        SQLiteDatabase db = this.getWritableDatabase();
        ContentValues cv = new ContentValues();
        cv.put(KEY_NAME, user.getBname());
        cv.put(KEY_DATE, user.getBdate());
        cv.put(KEY_GRP, user.getBgroup());
        cv.put(KEY_ADD, user.getBaddress());
        cv.put(KEY_PH, user.getPhno());

        // INSERT ROWS

        db.insertOrThrow(TABLE_NAME, null, cv);
        db.close();
    }

Following is the code from which I m calling my Insert Logic:

/*——————————- ADD RECORED ——————————– */

    btnadd.setOnClickListener(new OnClickListener() {

        public void onClick(View arg0) {
            // TODO Auto-generated method stub
    EditText ednm = (EditText)findViewById(R.id.txtname);
        String name = ednm.getText().toString();

        eddate = (EditText)findViewById(R.id.txtdate);
        String date1 = eddate.getText().toString();

        EditText edadd = (EditText)findViewById(R.id.txtadd);
        String add = edadd.getText().toString();

        EditText edno = (EditText)findViewById(R.id.txtno);
        String phno = edno.getText().toString();


    dbh.addUser(new BDFieldClass(name,date1,bgrp,add,phno));

Following is the LogCat Errors:

09-01 06:20:59.087: W/KeyCharacterMap(359): No keyboard for id 0
09-01 06:20:59.097: W/KeyCharacterMap(359): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
09-01 06:21:16.307: D/dalvikvm(359): GC_FOR_MALLOC freed 4630 objects / 232480 bytes in 119ms
09-01 06:21:30.917: D/Table_Created(359): table1
09-01 06:21:30.936: I/Database(359): sqlite returned: error code = 1, msg = table Table1 has no column named bname
09-01 06:21:30.947: D/AndroidRuntime(359): Shutting down VM
09-01 06:21:30.947: W/dalvikvm(359): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
09-01 06:21:30.976: E/AndroidRuntime(359): FATAL EXCEPTION: main
09-01 06:21:30.976: E/AndroidRuntime(359): android.database.sqlite.SQLiteException: table Table1 has no column named bname: , while compiling: INSERT INTO Table1(bname, bphno, bgroup, bdate, baddress) VALUES(?, ?, ?, ?, ?);
09-01 06:21:30.976: E/AndroidRuntime(359):  at android.database.sqlite.SQLiteCompiledSql.native_compile(Native Method)
09-01 06:21:30.976: E/AndroidRuntime(359):  at android.database.sqlite.SQLiteCompiledSql.compile(SQLiteCompiledSql.java:91)
09-01 06:21:30.976: E/AndroidRuntime(359):  at android.database.sqlite.SQLiteCompiledSql.<init>(SQLiteCompiledSql.java:64)
09-01 06:21:30.976: E/AndroidRuntime(359):  at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:80)
09-01 06:21:30.976: E/AndroidRuntime(359):  at android.database.sqlite.SQLiteStatement.<init>(SQLiteStatement.java:36)
09-01 06:21:30.976: E/AndroidRuntime(359):  at android.database.sqlite.SQLiteDatabase.compileStatement(SQLiteDatabase.java:1145)
09-01 06:21:30.976: E/AndroidRuntime(359):  at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1536)
09-01 06:21:30.976: E/AndroidRuntime(359):  at android.database.sqlite.SQLiteDatabase.insertOrThrow(SQLiteDatabase.java:1432)
09-01 06:21:30.976: E/AndroidRuntime(359):  at com.example.blooddonationapp.DBHelper.addUser(DBHelper.java:66)
09-01 06:21:30.976: E/AndroidRuntime(359):  at com.example.blooddonationapp.CreateClass$2.onClick(CreateClass.java:80)
09-01 06:21:30.976: E/AndroidRuntime(359):  at android.view.View.performClick(View.java:2408)
09-01 06:21:30.976: E/AndroidRuntime(359):  at android.view.View$PerformClick.run(View.java:8816)
09-01 06:21:30.976: E/AndroidRuntime(359):  at android.os.Handler.handleCallback(Handler.java:587)
09-01 06:21:30.976: E/AndroidRuntime(359):  at android.os.Handler.dispatchMessage(Handler.java:92)
09-01 06:21:30.976: E/AndroidRuntime(359):  at android.os.Looper.loop(Looper.java:123)
09-01 06:21:30.976: E/AndroidRuntime(359):  at android.app.ActivityThread.main(ActivityThread.java:4627)
09-01 06:21:30.976: E/AndroidRuntime(359):  at java.lang.reflect.Method.invokeNative(Native Method)
09-01 06:21:30.976: E/AndroidRuntime(359):  at java.lang.reflect.Method.invoke(Method.java:521)
09-01 06:21:30.976: E/AndroidRuntime(359):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
09-01 06:21:30.976: E/AndroidRuntime(359):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
09-01 06:21:30.976: E/AndroidRuntime(359):  at dalvik.system.NativeStart.main(Native Method)
09-01 06:21:33.286: I/Process(359): Sending signal. PID: 359 SIG: 9
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T14:16:28+00:00Added an answer on June 10, 2026 at 2:16 pm

    Use below string for creating table. Note the addition of spaces at the start of column type

       String CREATE_TABLE1 = "CREATE TABLE " + TABLE_NAME + "(" + KEY_ID
                + " INTEGER PRIMARY KEY, " + KEY_NAME + " TEXT, " + KEY_DATE
                + " TEXT, " + KEY_GRP + " TEXT, " + KEY_ADD + " TEXT, " + KEY_PH
                + " TEXT " + ")";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have table A and table B. I insert a entry into table
i have written insert query for my application to create new user with password,
I have an insert query that gets generated like this INSERT INTO InvoiceDetail (LegacyId,InvoiceId,DetailTypeId,Fee,FeeTax,Investigatorid,SalespersonId,CreateDate,CreatedById,IsChargeBack,Expense,RepoAgentId,PayeeName,ExpensePaymentId,AdjustDetailId)
I have to insert the values in the table named First, but before inserting
If I have an insert statement such as: INSERT INTO MyTable ( Name, Address,
I have to insert 8000+ records into a SQLite database using Django's ORM. This
Without macros, Excel can return the most recent entry. Imagine if I have insert
I have an INSERT query that works fine, but when I add an extra
I have an android app, which is basically an exam simulator, it will come
I am trying to insert an entry into a database using a form created

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.