3
I’m a beginner in C#, and I’m trying to remotely connect my C# application to a SQL Server database that is on another PC (the PC is not on the same network, it’s my friend’s), but it’s giving error. Before you speak, I’ve already set up the firewall, I’ve cleared the door.
Connectionstring:
<add name="connectionString"
providerName="System.Data.SqlClient"
connectionString="Data Source = xxx.xxx.xx.xx\nomeDoHost\(instacia padrão SQLEXPRESS), (porta padrão 1433);
Network Library = DBMSSOCN;
Initial Catalog = nome do banco;
User ID = usuario;Password = senha"/>
Just to make sure the ip that goes on xxx.xxx.xx.xx there is what I find here right : http://www.meuip.com.br/
Exception:
Have you tried this?
– Leonel Sanches da Silva
I’ve tried that too, I’ve tried that TCP/IP setup by SQL Server Configuration Manager also @Cigano Morrison Mendez
– Filipe
It can be a lot. His router, for example, if you don’t have a rule for port 1433, it won’t work.
– Leonel Sanches da Silva
It may be that what I am going to say, some disagree and etc... But I have always had problems connecting with Sqlserver passing the IP. I usually pass the full instance name_machine. This way I no longer have connection problems. Well, this is my experience.
– pnet
A tip, it is easier to put the server on a free SQL server than all this complication.
– PauloHDSousa
Thanks to everyone who tried to help the tips helped me find the problem, vlw, ta running here quiet
– Filipe