title: How do I set a default connection string in a console application?
body: <p>In my MVC projects with a web interface, I'm used to setting the Connection String in the Web.Config file. </p>
  
  <p>However, now I'm making a bog standard console application - also with a database hook, but how do I set the connection string globally for the application? </p>
  
  <p>At the moment, I am setting </p>
  
  <pre><code>var dbIndex = new DBContext();
  dbIndex.Database.Connection.ConnectionString = 
      "Data Source=USER-PC;Initial Catalog=TextProject.DBContext;" + 
      "Integrated Security=True;MultipleActiveResultSets=True";
  </code></pre>
  
  <p>but I have to set this connectionstring property every time, in all function calls. Is there a way to set a global connection string when I don't have a web.config? </p>