title: Why connecting to an OLEDB is giving me an connection error
body: <p>I have the following code which is connecting to my database and retrieving some data from a table:</p>
  
  <pre><code>    string connectionString = "Data Provider=SQLOLEDB;Data Source=myserver;Initial Catalog=Db;Integrated Security=FALSE;user=zh;pwd=zh12;";
  using (OleDbConnection connection = new OleDbConnection(connectionString))
  {
      connection.Open();
  
      OleDbCommand command = new OleDbCommand();
      command.Connection = connection;
      command.CommandText = "SELECT [Location], [URL], [TAGS] FROM [Db].[dbo].[BOOKINGTABLE]";
      command.CommandType = CommandType.Text;
  
      using (OleDbDataReader reader = command.ExecuteReader())
      {
          menu_ul_1.DataSource = reader;
          menu_ul_1.DataBind();
      }
  }
  </code></pre>
  
  <p>I get the following error:</p>
  
  <p><code>Exception Details: System.ArgumentException: An OLE DB Provider was not specified in the ConnectionString.  An example would be, 'Provider=SQLOLEDB;'.</code></p>
  
  <p>When I change the connectionstring line to:</p>
  
  <pre><code>string connectionString = "Provider=SQLOLEDB;Data Source=myserver;Initial Catalog=Db;Integrated Security=FALSE;user=zh;pwd=zh12;";
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>Exception Details: System.Data.OleDb.OleDbException: No error message available, result code: DB_E_ERRORSOCCURRED(0x80040E21).
  
  Source Error: 
  
  
  Line 23: using (OleDbConnection connection = new OleDbConnection(connectionString))
  Line 24: {
  Line 25:     connection.Open();
  Line 26: 
  Line 27:     OleDbCommand command = new OleDbCommand(); 
  </code></pre>
  
  <p>How can I resolve the issue?</p>
  
  <p>My Web.config file has the following line:</p>
  
  <pre><code>&lt;add key="ConnStringTEST" value="Data Source=myserver;Initial Catalog=Db;Integrated Security=FALSE;user=zh;pwd=zh12;" /&gt;
  </code></pre>
  
  <p>How, If, I can use the above line in my C# code?</p>