title: DNN Error - Can't Connect To Database
body: <p>I know this question has been asked many times, but none of the symptoms seem to match my problem and thus none of the solutions work.</p>
  
  <p>I am in the process of moving a DNN site (v. 7.04) from our company's IT infrastructure to an externally hosted VM as they were unable to give guaranteed up time. (The last straw was when their DNS server fell over Friday afternoon and we couldn't even contact anyone until Monday morning. Still took them two more days to fix it, but I digress...)</p>
  
  <p>I'm administering the VM so I have full access to it and the software running on it. I do not have access to the server on which the website and database are currently running.</p>
  
  <p>I have copied the website files from the old server to the new and have been provided with database backups which I have successfully restored on the new VM. The new VM is running IIS 8.5, SQL Express 2014 and Windows Server 2012 R2 Datacenter. I have set up the website in IIS and given read/write permissions to NETWORK SERVICE and IIS_IUSRS. The web.config file can be read as if I type something silly I get a syntax error showing the correct line.</p>
  
  <p>Now here is where things diverge from the trivial (for me at least). I can connect to the database (on the local machine) using Management Studio, HeidiSQL and the Data Link Properties dialog (see <a href="https://www.sophos.com/en-us/support/knowledgebase/65525.aspx" rel="nofollow">https://www.sophos.com/en-us/support/knowledgebase/65525.aspx</a>). All three of those work fine. When I put the connection string into the web.config, I get the can't connect error. The precise message is "DNN Error Connection To The Database Failed".</p>
  
  <p>Here's the connection string I'm using, it's nothing special and is what the production server is currently using, though with a different data source of course:</p>
  
  <pre><code>Data Source=[machine]\[instance];Initial Catalog=[database]; User ID=[user];Password=[password];
  </code></pre>
  
  <p>I'm guessing it's not the database itself since that seems to be fine and I can connect to it as mentioned, so I'm thinking maybe something in IIS?</p>
  
  <p>Any help would be appreciated.</p>