title: How to pass value to connection.cs from a Form in C# .Net?
body: <p>In my C# Application, I want to pass a connection string manually from a Form(formCon) to connection.cs. I've tried a lot and googled it, but nothing works fine.</p>
  
  <p>This is the code written in connection.cs:</p>
  
  <pre><code>class connection
  {
      public SqlConnection con;               
      public SqlCommand cmd = new SqlCommand();
  
      public connection()
      {        
          string conn = "Data Source=ds;Initial Catalog=initcat;uid=sa;pwd=pass";
          con = new SqlConnection(conn);
      }
  }
  </code></pre>
  
  <p>I want to replace <code>conn</code> with the value from frmCon which contains the connection string.</p>