title: How to know if a table exists in an Access Database in an OleDb connection
body: <p>I'm using the below code to connect to an Access Database using <code>OleDb</code> connection in <code>C# .Net</code></p>
  
  <p>How can I know if the table that I have hard-coded into the program actually exists in the file, so that I can show the user the appropriate message?</p>
  
  <pre><code>try
  {
      var dbSource = "Data Source = " + source;
      const string dbProvider = "PROVIDER=Microsoft.Jet.OLEDB.4.0;";
  
      using (var con = new OleDbConnection())
      {
          con.ConnectionString = dbProvider + dbSource;
          con.Open();
  
          using (var cmd = new OleDbCommand())
          {
              cmd.Connection = con;
              cmd.CommandText = "SELECT * FROM [Concrete Design Table 1]";
  
              // How do I know the table name is valid? It results in errors when it is not?
              // How to prevent it?
              using (var dataReader = cmd.ExecuteReader())
              {
                  while (dataReader != null &amp;&amp; dataReader.Read())
                  {
                      // read the table here
                  }
              }
          }
      }
  }
  catch (Exception e)
  {
      MessageBox.Show(e.ToString());
  }
  </code></pre>