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

  • SEARCH
  • Home
  • 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 6000071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:38:28+00:00 2026-05-23T00:38:28+00:00

I’m new to programming android, I’m trying to make a SQLite DAtabase but i

  • 0

I’m new to programming android, I’m trying to make a SQLite DAtabase but i keep get this error

06-05 17:10:59.164: ERROR/AndroidRuntime(268): FATAL EXCEPTION: main

06-05 17:10:59.164: ERROR/AndroidRuntime(268): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.c.notes/com.c.notes.Notes}:   android.database.sqlite.SQLiteException: no such column: _id: , while compiling: SELECT _id, title, body FROM note

I read were other people are having the same issue as me, but none of the solutions are working.
here’s my database adapter class where I believe the issue is

package com.c.notes;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

public class NotesDataBase {

/* public static final String Note_TITLE = "noteTitle";
 public static final String Note = "notee"; //these dont work must need other form for sql to work
 public static final String NoteID = "Noteid";
*/
  public static final String KEY_TITLE = "title";
    public static final String KEY_BODY = "body";
    public static final String KEY_ROWID = "_id";

 private static final String Iden = "notesLinkCable";
 private ACTNotesDBBuddy DatBuddy;//dbhelper was a coni
 private SQLiteDatabase ACTNotesDB;
/** private static final String Create_DataBase = 
        "create table note (Noteid integer primary key autoincrement, "
        + "noteTitle text not null, notee text not null);";
*/
 private static final String DATABASE_CREATE =
        "create table notes (_id integer primary key autoincrement, "
        + "title text not null, body text not null);";

 private static final String DBname = "DatBass";
 private static final String DatBassTable = "note";
 private static final int DatBassVER = 2;

 private final Context coni;



 private static class ACTNotesDBBuddy extends SQLiteOpenHelper {

     ACTNotesDBBuddy(Context context){
         super(context, DBname, null, DatBassVER);
     }

 @Override//1
 public void onCreate(SQLiteDatabase sld){
     sld.execSQL(DATABASE_CREATE);//so the data has so bs stuff pushed in it already lol
 }

 @Override//2
 public void onUpgrade(SQLiteDatabase slld, int old, int newV){
     Log.w(Iden, "I guess I'm upgrading sdl from ver" + old + " to " + newV +
                " ps I hear this will kill off the old king and knights saved");//this is a logCat tag I believe anyway this kills old data for an update...wont be doing that

        slld.execSQL("DROP TABLE IF EXISTS " + KEY_TITLE);
     onCreate(slld);
 }

 }
 //3
 public NotesDataBase(Context con){
     this.coni=con;
 }
 //4
 public NotesDataBase open() throws SQLException{
     DatBuddy = new ACTNotesDBBuddy(coni);
     ACTNotesDB =DatBuddy.getWritableDatabase();
     return this; 
 }
 //5
 public void close(){
     DatBuddy.close();
 }
  //6 a 10
 public long createNote( String name, String body){
     ContentValues Orgin = new ContentValues();
     Orgin.put(KEY_TITLE, name);
     Orgin.put(KEY_BODY,body);//my intial thought is this will over right each other but i believe its kinda like a stackish thing :)

     return ACTNotesDB.insert(DatBassTable ,null,Orgin);
 }

 //7a6
 public boolean deleteNote(long locoRow){
    return ACTNotesDB.delete(DatBassTable,KEY_ROWID + "=" + locoRow,null)>0; 
 }
 //8
 public Cursor fetchAllNotes(){
     return ACTNotesDB.query(DatBassTable, new String []{ KEY_ROWID,KEY_TITLE,KEY_BODY}, null, null, null, null, null);
     }



 //9a7
 public Cursor fetchNote(long rid) throws SQLException{
     Cursor cursor = ACTNotesDB.query(true, DatBassTable, new String [] {KEY_ROWID,KEY_TITLE,KEY_BODY}, KEY_ROWID +"="+rid, null, null, null, null, null);

     if(cursor != null){
         cursor.moveToFirst();
     }
     return cursor;
 }
 //10
  public boolean updateNote(long loco, String name, String note) {
        ContentValues info = new ContentValues();
        info.put(KEY_TITLE, name);
        info.put(KEY_BODY, note);
        return ACTNotesDB.update(DatBassTable, info, KEY_ROWID + "=" + loco, null) > 0;
    }




}
  • 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-05-23T00:38:29+00:00Added an answer on May 23, 2026 at 12:38 am

    The table you’re querying is saved as “note” in your database table name variable. You create the table as “notes” with an “s.”

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I'm looking for suggestions for debugging... If you view this site in Firefox or
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I want use html5's new tag to play a wav file (currently only supported
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a French site that I want to parse, but am running into

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.