[android-developers] Re: Column '_id' does not exist

2013-04-22 Thread Piren
it's not required by the DB, it's a requirement of CursorAdapter. You can have a table without it. It also does not have to be unique nor a primary key... it's just a value the adapter needs for getItemId, so if you're not using getItemId you can ignore those values (i always do.. not always the

[android-developers] Re: Column '_id' does not exist

2013-04-22 Thread lbendlin
As I understand it _id is a required field for SQLite database tables accessed by Android. Didn't know this also applies to string collections. In any case, since you control the UI of your application you can also decide to not display the _id field data. You may still need to provide the dat

Re: [android-developers] Re: column '_id' does not exist

2010-12-06 Thread Kostya Vasilyev
This is a convention in the framework that the primary key be called "_id", used by "simplified" adapter classes to make life easier for the developer. -- Kostya Vasilyev -- http://kmansoft.wordpress.com 07.12.2010 1:33 пользователь "Ashish" написал: > Well as per my understanding it is of ut

[android-developers] Re: column '_id' does not exist

2010-12-06 Thread Ashish
Well as per my understanding it is of utmost importance to have _id column in android sqlite database. This is the default way of making each record unique in its nature... so, even if you don't use any primary key, ur records won't be duplicate. Regards, Ashish On Dec 3, 1:31 pm, "Jonas Pet

Re: [android-developers] Re: column '_id' does not exist

2010-12-03 Thread Jonas Petersson
On 12/03/2010 09:04 AM, pramod.deore wrote: When I tried this as > [...] Cursor c = sampleDB.rawQuery("SELECT RoomID as _id FROM " +ROOM_TABLE_NAME, null); > [...] new String[] {"RoomID"}, > [...] java.lang.IllegalArgumentException: column

[android-developers] Re: column '_id' does not exist

2010-12-03 Thread pramod.deore
If I want to read one column from table and display these values (RoomName)on list then how to do this? if that table doesn't have _id field. should I read the RoomName of each row and store them into array. and then using arrayAdapter display the list? On Dec 3, 1:04 pm, "pramod.deore" wrote: >

[android-developers] Re: column '_id' does not exist

2010-12-03 Thread pramod.deore
When I tried this as try { sampleDB = this.openOrCreateDatabase(SAMPLE_DBNAME, MODE_PRIVATE, null); Cursor c = sampleDB.rawQuery("SELECT RoomID as _id FROM " +ROOM_TABLE_NAME, null); System.out.println ("Tota

Re: [android-developers] Re: column '_id' does not exist

2010-12-02 Thread Jonas Petersson
Um, you might try something like "select RoomID as _id ..." Best / Jonas On 12/03/2010 08:40 AM, Kumar Bibek wrote: You cannot in this case. This is a mandatory requirement. "pramod.deore" wrote: Hi Bibek, Thanks for reply. But my table RoomTable have only three colu

[android-developers] Re: column '_id' does not exist

2010-12-02 Thread pramod.deore
oh. Thanks On Dec 3, 12:40 pm, Kumar Bibek wrote: > You cannot in this case. This is a mandatory requirement. > > "pramod.deore" wrote: > >Hi Bibek, Thanks for reply. But my table RoomTable have only three > >columns, RoomID, RoomName, and RoomSuffix. It doesn't have  _id field. > >Then how to u

Re: [android-developers] Re: column '_id' does not exist

2010-12-02 Thread Kumar Bibek
You cannot in this case. This is a mandatory requirement. "pramod.deore" wrote: >Hi Bibek, Thanks for reply. But my table RoomTable have only three >columns, RoomID, RoomName, and RoomSuffix. It doesn't have _id field. >Then how to use Cursor Adapter here. > >On Dec 3, 11:55 am, Kumar Bibek wr

[android-developers] Re: column '_id' does not exist

2010-12-02 Thread pramod.deore
Hi Bibek, Thanks for reply. But my table RoomTable have only three columns, RoomID, RoomName, and RoomSuffix. It doesn't have _id field. Then how to use Cursor Adapter here. On Dec 3, 11:55 am, Kumar Bibek wrote: > Cursor Adapters require the table to have a _id field. Else, you would get > this