title: c# database connection.Open() error
body: <p>Error message keeps coming out pointing on the connection.open() on top ,and i'm unable to solve it after different tries of method imputing , Anyone? thanks! </p>
  
  <p>private void btnRegInfo_Click(object sender, EventArgs e)</p>
  
  <pre><code>     {
  
          OleDbConnection connect = new OleDbConnection();
  
          connect.ConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=:\Users\Student\Desktop\Database11.accdb";
          connect.Open();
      string Name = tbName.Text;
  
      OleDbCommand cmmd = new OleDbCommand("INSERT INTO table1(First Name)Values(@Name)", connect);
      if (connect.State == ConnectionState.Open)
      {
          cmmd.Parameters.Add("@Name", OleDbType.VarWChar, 20).Value = Name;
          try
          {
              cmmd.ExecuteNonQuery();
              MessageBox.Show("DATA ADDED");
              connect.Close();
          }
          catch (OleDbException expe)
          {
              MessageBox.Show(expe.Message);
              connect.Close();
          }
  
      }
  
  
      else
      {
          MessageBox.Show("CON FAILED");
      }
  
  
  
  
          if (tbName.Text != "Name" &amp;&amp; tbPass.Text != "Password")
              {
                  if (tbEmail.Text != "Email" &amp;&amp; tbMobile.Text != "Number")
                  {
                      if (tbFirstName.Text != "" &amp;&amp; tbLastName.Text != "")
                      {
                          const int MIN_LENGTH = 8;
  
                          string password = tbPass.Text;
  
                          if (password.Length &gt;= MIN_LENGTH &amp;&amp; upperCase(password) &gt;= 1)
                          {
                              r2.Text = "";
                              r2.ForeColor = Color.Red;
                          }
                          else
                          {
                              r2.Text = "*Password Is Bad*";
                              r2.ForeColor = Color.Red;
  </code></pre>