title: C# SQL connection string variable?
body: <p>In C# WinForms, where should I put my SQL connection string variable if I want to access it all over my application?</p>
  <p>Right now I'm copy-pasting it wherever I'm using it.</p>
  <pre><code>//Sql connection string
  
  SqlConnection con = new SqlConnection(@&quot;Data Source=&quot; + globalvariables.hosttxt + &quot;,&quot; + globalvariables.porttxt + &quot;\\SQLEXPRESS;Database=ha;Persist Security Info=false; UID='&quot; + globalvariables.user + &quot;' ; PWD='&quot; + globalvariables.psw + &quot;'&quot;);
  SqlCommand command = con.CreateCommand();
  </code></pre>