DataReader is null or empty
<p>Using C#</p>

<p>I have a datareader that return a lsit of records from a mysql database. </p>

<p>I am trying to write code that checks if the datareader isnull. The logic behind this is: If the datareader having field then display the info otherwise hide the field.</p>

<p>I have tried:</p>

<pre><code>cmd1 = new OdbcCommand("Select * from tb_car where vehicleno = '" + textbox2.text  + "';", dbcon);
        dr1 = cmd1.ExecuteReader();

if (dr1["tb_car"]. != DBNull.Value) 
{ 
    textbox1.Text  = "contains data"; 
} 
else 
{
    textbox1.Text = "is null"; 
}
</code></pre>

<p>The above code gives me this error:</p>

<p>Exception Details: System.IndexOutOfRangeException: Additional</p>

<p>Any help would be greatly appreciated...</p>
