title: The type initializer for 'Oracle.DataAcces.Client.OracleConnection' threw an exception
body: <p>When I try to connect to an Oracle database in my C# application and I try to click a button I get this error:</p>
  
  <blockquote>
    <p>The type initializer for 'Oracle.DataAcces.Client.OracleConnection'
    threw an exception</p>
  </blockquote>
  
  <p>My code for accessing the database:</p>
  
  <pre><code>        static string column;
          static string OracleServer = "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=something)(HOST=something)(PORT=something)) (CONNECT_DATA=(SERVICE_NAME=name)));User Id=something;Password=something;";
  
          public void read()
          {
              try
              {
                  var conn = new OracleConnection(OracleServer);
                  conn.Open();
                  OracleCommand cmd = new OracleCommand("select * from t1", conn);
                  OracleDataReader reader = cmd.ExecuteReader();
  
                  while (reader.Read())
                  {
                      var column1 = reader["vermogen"];
                      column = (column1.ToString());
                      listBox1.Items.Add(column);
                  }
                  conn.Close();
              }
              catch (Exception ex)
              {
                  MessageBox.Show(ex.Message);
              }
  
          }
  </code></pre>
  
  <p>Now I am using the reference <code>Oracle.DataAccess</code> and as code: <code>using Oracle.DataAccess.Client;</code></p>
  
  <p>The application is an arcgis add in application, and I converted it to a form application and it does connect to the database. But I have to have it work in the add in application. </p>
  
  <p>I have never experienced this error and I am not experienced at Oracle databases and I was wondering what is causing this error? When I run the application, I dont get any errors. But when I click the buttons of the User Interface of the application, I get this error.</p>
  
  <p>What should I do to lose the error and what is causing it?</p>