0

I'm running through the Get Started with Azure Cloud Services tutorial.

When I build and run the sample project, Database I/O errors with:

A network-related or instance-specific error occurred while establishing a 
connection to SQL Server. The server was not found or was not accessible. 
Verify that the instance name is correct and that SQL Server is configured 
to allow remote connections. (provider: SQL Network Interfaces, error: 50 - 
Local Database Runtime error occurred. Cannot create an automatic instance. 
See the Windows Application event log for error details.)
  1. I am running VS.NET 2017, and did make the recommended change:

    If you're using Visual Studio 2015 or higher, change the SQL Server connection string in the application Web.config file of the ContosoAdsWeb project and in the ServiceConfiguration.Local.cscfg file of the ContosoAdsCloudService project. In each case, change "(localdb)\v11.0" to " (localdb)\MSSQLLocalDB".

    In my ServiceConfiguration.Local.cscfg:

      <Setting name="ContosoAdsDbConnectionString" value="Data Source=(localdb)\MSSQLLocalDB; Initial Catalog=ContosoAds; Integrated Security=True; MultipleActiveResultSets=True;" />
    
  2. I verified that the SQL Express localdb exists and can be connected to: SQL Server Object Explorer

If anyone has any ideas or suggestions, I would be very grateful. Thanks!

Edit: Windows Application Log Error (it's the same error, just repeated several times) Application Log error

Philip Tenn
  • 6,003
  • 8
  • 48
  • 85
  • 1
    Does this answer help you? Maybe you're not escaping the backslash? https://stackoverflow.com/questions/12463228/unable-to-connect-to-localdb-in-vs2012-a-network-related-or-instance-specific/12463683#12463683 – Jaxidian May 03 '17 at 14:27
  • @Jaxidian Thank you for the suggestion. I tried: ``, however it still gives the same error. – Philip Tenn May 03 '17 at 14:31
  • 1
    Have you looked to see what the additional info is in the event log? – Jaxidian May 03 '17 at 14:33
  • @Jaxidian I did look at it earlier, but it did not give me any useful information. I edited the post to provide it as well. – Philip Tenn May 03 '17 at 14:43
  • 1
    Actually, that appears to be related to your Azure Diagnostics connectionstring and not necessarily (but maybe, depending on your config?) your application db connectionstring. Are they one and the same for your app? – Jaxidian May 03 '17 at 15:25
  • 1
    @Jaxidian Thank you so much for all your help on this. I ended up needing to move forward and just installed SQL Server Express 2012 (see my answer below). Wish I knew why the `localdb` didn't work, I put my guesses in the answer. – Philip Tenn May 03 '17 at 15:50

1 Answers1

0

I ended up punting on this and installing SQL Server 2012 Express edition and using the connection string:

<Setting name="ContosoAdsDbConnectionString" value="Data Source=MACHINE_NAME\SQLEXPRESS; 
Initial Catalog=ContosoAds; Integrated Security=True; MultipleActiveResultSets=True;" />

That worked great.

The only thing I can think of is I am running Windows 7 and Visual Studio 2017.

I believe VS.NET 2017 may bundle SQL Server 2016, which I know is not compatible with Windows 7.

Philip Tenn
  • 6,003
  • 8
  • 48
  • 85