Jags wrote:
> i have named it differently, i just wrote it MyID not to publish too
> many info in a public forum, copywright you know. :)

It is more that _ID will work better if you use CursorAdapter.
CursorAdapter needs a unique key named _ID. You can always rename the
column in your query (SELECT _ID=MyId, ...), but it's unclear why that's
better than just having it named _ID in the first place.

> i observed, the pk value is all blank...
> 
> while putting in COntentValues, I am putting nothing for MyId, as I
> expect it to be auto generated.

If by "putting nothing for MyId", you mean you do not have an entry *at
all* in your ContentValues, that should be fine.

If by "putting nothing for MyId", you mean you are putting a null or
empty-string entry for MyId in your ContentValues, that may not work well.

Here is an example of a project accessing a SQLite database:

http://github.com/commonsguy/cw-android/tree/master/Database/Constants/

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Android Training in Germany, 18-22 January 2010: http://bignerdranch.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