I have an instance of SQL Azure and you can connect to it without problems in SQL Server Management Studio. However, when my application tries to connect, this error occurs:
A network or specific instance error occurred while creating a connection to SQL Server. The server was not found or was unavailable. Verify that the instance name is correct and that SQL Server is configured for a remote connection. (provider: SQL network Interfaces, error: 26 - Search error Specified server / instance)
I am using Entity Framework Code First 4.1 and ASP.NET MVC 3. My application was originally developed successfully using SQL Express. Now I use this tutorial to move the database to SQL Azure (the application will also move there, but development continues).
Since SSMS is working fine, I assume it comes down to web.config? I tried every combination of connection string name:
<connectionStrings> <add name="ApplicationServices" connectionString="Server=tcp:suppressed.database.windows.net,1433;Database=EventsTest;User ID=suppressed;Password=suppressed;Trusted_Connection=False;Encrypt=True;PersistSecurityInfo=True;" providerName="System.Data.SqlClient" /> <add name="DomainContext" connectionString="Server=tcp:suppressed.database.windows.net,1433;Database=EventsTest;User ID=suppressed;Password=suppressed;Trusted_Connection=False;Encrypt=True;PersistSecurityInfo=True;" providerName="System.Data.SqlClient" /> <add name="Events.DataAccess.EntityFramework.DomainContext" connectionString="Server=tcp:suppressed.database.windows.net,1433;Database=EventsTest;User ID=suppressed;Password=suppressed;Trusted_Connection=False;Encrypt=True;PersistSecurityInfo=True;" providerName="System.Data.SqlClient" /> </connectionStrings>
I also tried Wireshark, which I know very little about, but seems to offer some activity (192.168.1.101 - my machine, 207.46.63.13 - SQL Azure server):
1 0.000000 192.168.1.101 207.46.63.13 TCP [TCP segment of a reassembled PDU]
2 0.116269 207.46.63.13 192.168.1.101 TCP ms-sql-s> bmc-net-adm [ACK] Seq = 1 Ack = 2 Win = 8444 Len = 0
3 2.091928 192.168.1.101 207.46.63.13 TCP [TCP segment of a reassembled PDU]
4 2.209371 207.46.63.13 192.168.1.101 TCP ms-sql-s> kmscontrol [ACK] Seq = 1 Ack = 2 Win = 5969 Len = 0
5 2.352974 192.168.1.101 207.46.63.13 TCP [TCP segment of a reassembled PDU]
6 2.469444 207.46.63.13 192.168.1.101 TCP ms-sql-s> vaultbase [ACK] Seq = 1 Ack = 2 Win = 8625 Len = 0
Any ideas what could happen?
Alex angas
source share