title: Call connection string from class
body: <p>So i'm really annoyed now.(Still a noob) I'm trying the use my connection string that I created in my "Common" class on my "Logon" form so that i can call a "hhrcv_logon_validation" procedure.</p>
  
  <p>My quesation is how?</p>
  
  <p>I've searched everywhere and yes I do get examples but I need someone to explain them better for me please? And maybe some example code as well.</p>
  
  <p>I know I have to create the class for the connection string and the use that connection string to call a proc? Am i right?</p>
  
  <p>This is my code :</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Text;
  using CoreLab.Oracle;
  
  namespace WMS
  {
      class Common
      {
          static void connect()
          {
              // Connect
              string constr = "User ID=Password;" +
              "Password=Username;" +
              "Host="ServerName";" +
              "Pooling=true;" +
              "Min Pool Size=0;" +
              "Max Pool Size=100;" +
              "Connection Lifetime=0";
              OracleConnection con = new OracleConnection(constr);
              con.Open();
       }
  }
  </code></pre>
  
  <p>Please help!? </p>
  
  <hr>
  
  <p>So below is what I did with your sample code:
      
  
  <pre><code>namespace WMS
  {
  class Common
  {
      public static string ConnectionString
      {
          get
          {
              return ConnectionString;
          }
          set
          {
              ConnectionString = "User ID=username;" +
              "Password=password;" +
              "Host=hostname;" +
              "Pooling=true;" +
              "Min Pool Size=0;" +
              "Max Pool Size=100;" +
              "Connection Lifetime=0";
          }
      }
  
      public static OracleConnection OpenConnection()
      {
          OracleConnection con = new OracleConnection(ConnectionString);
          con.Open();
          return con;
      }
   }
  } 
  </code></pre>
  
  <p>Will this work?</p>
  
  <p>And how would I then access it from a form? With this:</p>
  
  <pre><code>&lt;using(var conn = Common.OpenConnection()) {
   // use it
  }
  </code></pre>