Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>An eternal problem! :-)</p> <p>Basically, right now, Microsoft doesn't really have a good answer for this.</p> <p>What I would do is have both connection strings in my settings file, under two separate names, and then have a config setting in app.config which tells me which one to use:</p> <pre><code>MyDatabaseDEV = server=(local);database=mydatabase;-........ MyDatabasePROD = server=ProdServer;database=MyDatabase;........ </code></pre> <p>and in app.config</p> <pre><code>&lt;appSettings&gt; &lt;add key="UseDatabase" value="MyDatabaseDEV" /&gt; &lt;/appSettings&gt; </code></pre> <p>This setting in app.config can be tweaked in your build process, e.g. by a "after build" batch file, or an MSBuild task or something, to be switched to "MyDAtabasePROD", when you do a production (release) build.</p> <p>Microsoft promises us more and more flexible tools for .NET 4.0 / Visual Studio 2010, which should be out by the end of the year 2009. You should be able to create "config transformations" - check out these blog posts:</p> <ul> <li><a href="http://blogs.msdn.com/webdevtools/archive/2009/05/04/web-deployment-web-config-transformation.aspx" rel="nofollow noreferrer">Web Deployment: Web.Config Transformation</a></li> <li><a href="http://www.asp.net/learn/whitepapers/aspnet40/#_Toc223325501" rel="nofollow noreferrer">ASP.NET 4.0 and Visual Studio 2010 Web Development Beta 1 Overview</a></li> <li><a href="http://weblogs.asp.net/gunnarpeipman/archive/2009/06/16/visual-studio-2010-web-config-transforms.aspx" rel="nofollow noreferrer">Visual Studio 2010: Web.config transforms</a></li> <li><a href="http://leedale.wordpress.com/2009/02/27/webconfig-transformations-with-visual-studio-2010/" rel="nofollow noreferrer">Web.config Transformations with Visual Studio 2010</a></li> </ul> <p>Marc</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload