Question

I am hosting my asp.,net application in Azure. The home page has published and is showing up fine. However, when logging in and connecting to my Sql Server database, the following error is coming up:

Stack Trace:

[Win32Exception (0x80004005): The system cannot find the file specified]

[SqlException (0x80131904): 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: 52 - Unable to locate a Local Database Runtime installation. Verify that SQL Server Express is properly installed and that the Local Database Runtime feature is enabled.)]

So I'm after changing my connection string in my login page to the following:

SqlConnection con = new SqlConnection(@"Data Source=Server: qel61spgsl.database.windows.net,1433;Database=[fitnessAllDZ49fS];User ID='***';Password=[***]");

Is this format correct?

Also I have changed my web config file to the above connection string also.

Is there anything else I could try?

Thanks in advance!

Was it helpful?

Solution

Here's the correct format:

Data Source=qel61spgsl.database.windows.net,1433;Initial Catalog=fitnessAllDZ49fS;User ID='***';Password=[***]

Also check that you allowed connections to your sql azure from other azure services: From the Azure Management Portal go to your sql database -> navigate to the "configure" section -> click "Manage allowed IP addresses" -> ensure that "Allowed Services/Windows Azure Services" is set to ON.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top