I am trying to run my SQL Server based Winform application from two computers which are connected in LAN.(Desktop PC, Laptop)
I followed MSDN and the below mentioned StackOverflow answers:
LINK 1 (Verified Answer)
LINK 2 (dyslexicanaboko's Answer)
I tried the below steps:
My Winform app's connection string:
<connectionStrings>
<add name="WinFormMetroTest.Properties.Settings.SampleDBConnectionString"
connectionString="Data Source=192.168.1.6\SAINSTANCE;Initial Catalog=SampleDB;User Id=sa;Password=bpmadmin1;Integrated Security=False;"
providerName="System.Data.SqlClient" />
</connectionStrings>
In my Laptop:
- I have SQL Server 2008 R2 Enterprise edition, Windows 7 64bit Ultimate.
- In SQL Server Configuration Manager, I enabled the protocol for TCP/IP for my instance "SAINSTANCE" and in the IP addresses, I specified TCP port as 1433 for all IPs. In IP4, I mentioned my Laptop's IP
192.168.1.6
and restarted SQL Server Instance and SQL Server Agent. - In Firewall setting,
Inbound Rules
- Specified TCP port as 1433
And finally I run my application in my Laptop, it gets connected to my DB and works perfectly.
In my Desktop PC:
- I have Windows 64 bit Ultimate. I do not have SQL Server 2008 R2 or any other version here.
- In Firewall setting,
Inbound Rules
- Specified TCP port as 1433 and also UDP port as 1434Outbout Rules
- Specified TCP port as 1433 and also UDP port as 1434
Now I ran my application in Desktop PC and it shows connection error. I also disabled firewall completely in my Desktop PC and tried, it doesn't connect and shows the same error.
Please tell if I went wrong in any steps which I referred or provide possible fix for this.
Please comment if you require any further details about this issue.