Reputation: 471
I am using SQL Server 2008 R2 Express and EF 6.
Here is my connection string which I place in app.config
:
<connectionStrings>
<add name="StructuralSynthesisConnection"
connectionString="data source=192.168.0.103\sqlexpress;Network Library=DBMSSOCN;initial catalog=StructuralSynthesisDB;integrated security=True;pooling=False;MultipleActiveResultSets=True;App=EntityFramework"
providerName="System.Data.SqlClient" />
</connectionStrings>
It connects only to current computer (192.168.0.103) ONLY with ip I mentioned (it`s my local ip using wifi). When I try to connect from another computer or/and with my real ip it fails.
I turned off windows firewalls, checked default sql port (1433), no dynamic ports, tried connection string with port. Nothing helped. Also (of course) I checked my internet connection and work of SQL Server Express on all devices I am using. They are all in local (wifi) network, maybe it makes some difference?
Upvotes: 0
Views: 1338
Reputation: 730
Ok, you should check this https://blogs.msdn.microsoft.com/walzenbach/2010/04/14/how-to-enable-remote-connections-in-sql-server-2008/.
I Think it has a few configuration that you did not mention and how to implement it.
A few month a ago i had the same problem and i set everything with the correct configuration and i did not get the connetion, and my problem was that my Antivirus was bloking the connetion.
I hope it help.
Upvotes: 1