title: Check Database for username or password OledDb Connection
body: <p>I'm trying to check a database that i have connect to my program for user name and password i have my query made but how would i go about checking it against a table.</p>
  
  <pre><code>    private void button1_Click(object sender, EventArgs e)
      {
          Menu m1 = new Menu();
          string connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=UserAccounts.accdb; Persist Security Info=False;";
          OleDbCommand cmd = new OleDbCommand("Select * from UserAccounts where Username = " +userBox.Text + " and Password] = " + Password.Text + "");
          using (OleDbConnection conn = new OleDbConnection(connectionString))
          {
              try
              {
                  conn.Open();
                  this.Hide();
                  m1.Show();
              }
              catch (Exception exc)
              {
                  MessageBox.Show(exc.Message);
              }
          }
      }
  </code></pre>