Reputation: 565
After 2 Days of search i still didnt find an answer.
Situation:
Server:
SQL Server 2008 Express installed on RemoteServer
TCP/IP: Enabled on port 1433
Named Pipes: Enabled
Database: ConDB.mdf (attached to server)
Workstation:
Microsoft Management Studio: Connection to database works
Servertype: Databasemodul
Servername: MTTC5020\SQLEXPRESS,1433
Authentifcation: SQL Server-Authentification
Username: testuser
Password: 1234
Visual Studio 2010 Express:
Error on Database Explorer: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified
Same Error Through Connection via Appconfig and connectionstring:
<connectionStrings>
<add name="ContainerDB.My.MySettings.ConDBConnectionString" connectionString="Data Source=MTTC5020\SQLEXPRESS,1433;Initial Catalog=ConDB.mdf;User ID=testuser;Password=1234;Integrated Security=false"
providerName="System.Data.SqlClient.SqlConnection" />
</connectionStrings>
I also tried many other connectionstrings (Via IP / AttachedDBFileName / etc.)
I also tried everything here: MSDN
portcheck through SQLCMD -U testuser -P 1234 -S MTTC5020\SQLEXPRESS,1433 works aswell
Any suggestions?
Upvotes: 1
Views: 809
Reputation: 565
I now found the issue. The connectionstring for the dbml is not only stored in the .config file.
checkout the workaround for this at: LINQ to SQL Connection Strings
Upvotes: 1
Reputation: 495
Because by default express editions are installed as named instances, SQL Server on the remote machine needs to be allowed in firewall, not only the port, but the service, because named instances probably will change the port from time to time. Check this post, hope this helps blogs.msdn.com/b/sqlexpress/
Upvotes: 0