I am trying to make my program, that uses SQL Server, available on another machine. I know that that machine will need the SQL Server Client installed for this to work, but I am wondering if my ConnectionString will work outside of my own PC.
Do I need to attach my Database to the Project? And if so, how could I do that?
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
<connectionStrings>
<add name="DefaultConnection" connectionString="Data Source=.\BENESQL;Initial Catalog=Northwind;Persist Security Info=True;User ID=sa;Password=123qwe;" providerName="System.Data.SqlClient" />
</connectionStrings>
</configuration>
Your data source must contain either other PC name or IP address, so instead of:
Data Source=.\BENESQL
you need something like:
Data Source=123.123.123.123\BENESQL
Also you need to remember to add exceptions to firewall etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With