1 Replies - 558 Views - Last Post: 19 September 2012 - 05:12 AM

#1 Nwa9ja  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 04-July 12

Database insertion problems

Posted 18 September 2012 - 04:07 AM

Hey guys, just started with android and I am having problems inserting values into my mysqlite.
The application is supposed to be a simple appllication that gets an entry from the user, consisting of a title and content and displays it.

Here is a clip of the code

public void insertData(String title, String content) {
       ContentValues values = new ContentValues();
       values.put("title", title);
       values.put("content", content);
       
       try {
    	  database.insertOrThrow(ENTITY_TABLE, null, values); //<---ERROR POINTER
    	  } catch (SQLException e) {
    	   Log.e(ENTITY_TABLE, e.toString());
    	  }
       
   }


the debuger keeps breaking at that line of code but I can see no errors in my application. This is driving me crazy.

MOD EDIT: Added code tags. When posting code...USE CODE TAGS!!!

:code:

This post has been edited by JackOfAllTrades: 18 September 2012 - 04:28 AM


Is This A Good Question/Topic? 0
  • +

Replies To: Database insertion problems

#2 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10778
  • View blog
  • Posts: 40,134
  • Joined: 27-December 08

Re: Database insertion problems

Posted 19 September 2012 - 05:12 AM

What does your Logcat say?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1