Cursor always empty Android SQLite. Cannot find column?
<p>I am trying to return a string from a database, but for some reason it looks as if the cursor cannot find the Column? I think?</p>

<p>This is the code im having problems with:</p>

<pre><code>Cursor resultSet = myDbHelper.findUser(userName);
    resultSet.moveToFirst();
    String result="";

    TextView t1 =(TextView)findViewById(R.id.textView);

    boolean a = (resultSet != null);
    boolean b = (resultSet.moveToFirst());

    if(resultSet != null &amp;&amp; resultSet.moveToFirst())
    {
        result = resultSet.getString(resultSet.getColumnIndex("Name"));
        t1.setText("String= "+result);
    }
</code></pre>

<p>And this is the helper method that is being called:</p>

<pre><code>public Cursor findUser(String uName)
{
    Cursor res = myDatabase.query("Person WHERE Name = '"+uName+"';",
            null,null,null,null,null,null);
    return res;
}
</code></pre>

<p>For some reason when im debugging the app the boolean variables i have created A becomes True and B stays false, so i know it must be an issue with the Cursor moveToFirst, but i dont know whats up?  the String result also remains empty.</p>

<p>Can anyone help me where im going wrong.  The column in the DataBase is called Name, from the Person table.</p>