sqlite databse retrival to gridview widget

103 views
Skip to first unread message

Chitra

unread,
Nov 19, 2010, 10:08:48 AM11/19/10
to android-platform
Hi,

I am new to Android.May I know how to retrieve my sqlite database
table content to a gridview .I haven't specified any number of columns
to gridview .Is it possible to get the entire database table content
with field names to gridview.
mDb.query(EXPENSE_TABLE_NAME, new String[] {KEY_ITEM, KEY_AMOUNT,
KEY_PAIDBY}, null, null, null, null, null);

I used this line of code to retrieve the table to a curser. Curser
adapter to gridview widget databinding I would like to know.

I dont't have an _id column in my database table. I heared that SQLite
doesn't work without _id column.Is that true?

Upen

unread,
Nov 19, 2010, 8:14:50 PM11/19/10
to android-platform
That is true.. _id column is required..

However, u can use a customized primary key for any other column..n
make it wrk like the _id .
Reply all
Reply to author
Forward
0 new messages