Showing posts with label Tech Experiences. Show all posts
Showing posts with label Tech Experiences. Show all posts

Thursday, November 4, 2010

Java.lang.IllegalArgumentException: column '_id' does not exist

Its a common error when we use a data adapter in ANDROID for the first time. I used it to extract all the contacts.

So we declare a SimpleCursorAdapter as follows



SimpleCursorAdapter adapter = new SimpleCursorAdapter(
this,
R.layout.contactsview,
c,
projection,
new int[] {R.id.contactEntryText}
);




I used the projections as follows


String [] projection = new String [] {
ContactsContract.Contacts.DISPLAY_NAME
};


I got the exception Java.lang.IllegalArgumentException: column '_id' does not exist.

Make sure that the projection you have mentioned above do contain a field called as ContactsContract.Contacts._ID.

So you have to redeclare the array projection as




String [] projection = new String [] {
ContactsContract.Contacts.DISPLAY_NAME,
ContactsContract.Contacts._ID
};



Thats it. Now you are good to go !!!!!!!!

Friday, October 8, 2010

ERROR 1030 (HY000): Got error 28 from storage engine

This is a common MySQL error which everyone faces. Dont get panic. This is just because of lack of space in the server. Clean up some files in your machine that you think as not needed. Now execute the query. You are all set:-). Happy Querying