15.12.2010 14:05, pramod.deore пишет:
Hi every time I get  _ID value as 1. I used following line to get
value
  mGroupIdColumnIndex = groupCursor.getColumnIndexOrThrow("_id");


That's the index of column "_ID" within your query, not the value stored in the database.

http://developer.android.com/reference/android/database/Cursor.html#getLong(int)

And you told me that usethis is in where condition into following
query.

Cursor groupCursor1 = sampleDB.rawQuery ("SELECT DISTINCT
RoomName AS RoomName1 ,_id , SwitchFullName FROM SwitchTable ORDER BY
RoomName",null);

See last parameter:

http://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.html#rawQuery(java.lang.String, java.lang.String[])

Also:

http://www.sqlite.org/lang_select.html#whereclause

--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.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

Reply via email to