title: Trying to connect to accdb database with c# and .NET 4.0
body: <p>I keep getting an exception when I try to fill the adapter and i can't figure out why.  Here is my code.  Thank you very much in advance for any information!</p>
  
  <pre><code>public partial class MainWindow : Window
  {
      private OleDbConnection connection;
      private OleDbCommand command;
      private OleDbDataAdapter adapter;
      private DataSet dataset;
  
      public MainWindow()
      {
          InitializeComponent();
  
          connection = new OleDbConnection();
          command = new OleDbCommand();
          adapter = new OleDbDataAdapter();
          dataset = new DataSet();
  
          connection.ConnectionString =
              @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:/SoBeWFF.accdb;" +
              "Persist Security Info=False";
  
          command.Connection = connection;
          command.CommandText = "SELECT * FROM Dishes";
  
          adapter.SelectCommand = command;
  
          try
          {
              adapter.Fill(dataset, "Dishes");
          }
          catch (OleDbException)
          {
              MessageBox.Show("Error occured while connecting to database.");
             // Application.Exit();
          }
      }
  }
  </code></pre>