title: OleDbException was unhandled by user code in c#
body: <p>Here is the cs file:</p>
  
  <pre><code>public int CheckExisting(String sqlDbQry, String sTable)
      {
          Qry = sqlDbQry;
          con = new OleDbConnection(connectionstr);
          if (con.State == ConnectionState.Open)
              con.Close();
          con.Open();
          cmd = new OleDbCommand(Qry, con);
          dr = cmd.ExecuteReader();
          while (dr.Read())
              rQry = Convert.ToInt32(dr[0].ToString());
          con.Close();
          return rQry;
      }
  </code></pre>
  
  <p>Here is my another cs:</p>
  
  <pre><code>protected void btnsub_Click(object sender, EventArgs e)
          {
              if (objAdmin.CheckExisting("SELECT COUNT(*) FROM registration where Email='" + Textemail.Text.Trim() + "'", "Temp") &gt; 0)
              {
                  lblmail.Text = "Your EmailId already Registered, Please Login!";
                  return;
              }
              if (objAdmin.CheckExisting("SELECT COUNT(*) FROM registration where Phone_num='" + Textphone.Text.Trim() + "'", "Temp") &gt; 0)
              {
                  lblmail.Text = "Mobile number already exists, Please Login!";
  
                  return;
              }
  }
  </code></pre>
  
  <p>When i enter input details and hit submit, it shows error something like this,</p>
  
  <p>Here is the error of <a href="http://imgur.com/SMw5TWc" rel="nofollow">Screenshot</a></p>
  
  <p>Can anyone help me to fix this?</p>