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 'RoomID' does not exist
Yes, that is to be expected, you have just "renamed" the RoomID column
to "_id" so obviously you must also access it that way (or ALSO select
it under the original name, but that would be confusing IMHO).
/ Jonas
On Dec 3, 12:51 pm, "Jonas Petersson"<[email protected]> wrote:
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"<[email protected]> 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<[email protected]> wrote:
Cursor Adapters require the table to have a _id field. Else, you would get
this exception.
Kumar Bibekhttp://techdroid.kbeanie.comhttp://www.kbeanie.com
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en