android & sqlite - Query a single item -


I'm calling a method to see if there is a value within the database or not.

  string [] column = {table.NAME}; String [] selections = {name}; Cursor cursor = db.query (table.TABLE_NAME, column, table. Name + "=?", Selection ARGS, blank, empty, empty, blank); Int index = cursor.getColumnIndex (table.ID);  

Whether the name exists or does not always index -1?

Whether the name exists or does not always index -1?

Because you have not included the column in table.ID .

getColumnIndex


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -