title: ConnectionString Exception In Oracle database
body: <p>I want to insert some data into an Oracle database through a C# application. </p>
  
  <p>I keep getting an exception which looks like this : "The ConnectionString has not been properly initialized".
  The code for inserting is bellow:</p>
  
  <p>try
              {</p>
  
  <pre><code>                conn.openConnection();
  
                  OracleCommand cmd = new OracleCommand();
                  cmd.Connection = conn.Connection;
                  cmd.CommandType = CommandType.Text;
  
                 String sqlCommand = "INSERT INTO ComandaDVD (Id_Comanda,Id_Format,Data_Comanda,Id_TipPlata,Pret) VALUES (" +
                      "'" + txt_idComanda.Text + "', " +
                      "'" + txtFormat.Text + "', " +
                      "to_date('" + txtData.Text + "', 'DD-MM-YYYY'), " +
                      "'" + txtIdTipPlata.Text + "', " +
                      "'" + txtPret.Text + "')";
  
                  cmd.CommandText = sqlCommand;
  
                  int result = cmd.ExecuteNonQuery();
                  if (result &gt; 0)
                  {
                      MessageBox.Show("Comanda cu id_comanda[" + txt_idComanda.Text + "]a fost primita!");
  
                  }
                  else
                  {
                      MessageBox.Show("Eroare");
                  }
  
                  conn.closeConnection();            
          }
  
          catch (Exception ex)
          {
              MessageBox.Show("Exceptie" + ex.Message);
          }         
      }
  </code></pre>
  
  <p>I also made a personalized class to ease the connection handling:
   class Conexiune_DB
      {</p>
  
  <pre><code>    private OracleConnection conn;
      private static string CONNECTION_STRING = "Data Source=80.96.123.131/ora09;User Id=hr;Password=oracletest;";
  
      public Conexiune_DB() { conn = new OracleConnection(CONNECTION_STRING); }
  
      public void openConnection() { conn.Open(); } 
  
      public void closeConnection() { conn.Dispose(); } 
  
      public OracleConnection Connection
      {
          get { return conn; }     
      }
  
  }
  </code></pre>
  
  <p>The exception appears to be because of 'conn.Open' in that class. Which is weird, because i made some insertions before, and i didn't have any problems.</p>
  
  <p>Thanks in advance.</p>