C
C#3y ago
kami

What is the process for making SQL server open to remote connections?

I've been making a program that works with a database on sql server, but for some reason if anyone else tries using it to connect, the connection always fails for whatever reason. Current error is in screenshot, "provider: TCP Provider, error:0-No such host is known." I've gone through everything, allowing port 1434 in firewall, turning off firewall completely, allowing remote connections in sql, enabling all the tcp/udp stuff in the configuration manager(they were already enabled by default). Is there an issue with the connection string? Or do I need to portforward sql server to make it a static port?
20 Replies
Yawnder
Yawnder3y ago
Are they using the proper IP (or domain name)? Are they capable of reaching it with SSMS? What license is the Sql Server using?
kami
kamiOP3y ago
<add name="testdb" connectionString="Data Source=tcp:(desktopname)/1434;Initial Catalog=ThapsicoTest;Persist Security Info=True;User ID=TestDBDefaultAccess;Password=password"/> this is the connection string i haven't tested this yet. so they can connect to my sql server through theirs, then the issue must be something in the program itself and license, it's just the basic sql server? the free entry lvl one in the conn string, i didn't put my ip. i wasn't sure which one to use
Yawnder
Yawnder3y ago
Oh, you guys are on the same network; it's not over internet? "they can connect to my sql server through theirs" What do you mean "through theirs"? Using their SSMS?
kami
kamiOP3y ago
no we aren't. it's over the internet. and when i say "through theirs", i mean if they can connect to my ssms using their ssms, then it must be an issue with the program i made in c#
Yawnder
Yawnder3y ago
tcp:(desktopname)? desktopname is the local name of your machine?
kami
kamiOP3y ago
yes, i set the server name to be the same as the desktop name
Yawnder
Yawnder3y ago
And you expect the local machine name to resolve over the internet?
kami
kamiOP3y ago
yeah, it should. so long as i provide the username and password in the connection string, to my understanding it'll be able to discern it's connecting to an instance of sql
Yawnder
Yawnder3y ago
I'm not talking about authentication I'm talking about resolving the path from their computer -> Router -> Modem -> ISP -> Your Modem
kami
kamiOP3y ago
so, computer, router, modem, isp, modem, desktopname/desktopname/sqlserver hm yeah you're right first thing i'll change the name
Yawnder
Yawnder3y ago
My point is that it needs to be a name, or an IP, that is reachable from the outside of your network. Either through a DNS or an IP
kami
kamiOP3y ago
which ip would i use? i wasn't sure which to pick from the ssms config manager
Yawnder
Yawnder3y ago
google "what's my IP". That one.
kami
kamiOP3y ago
okay. the one in the xx.xxx.x.xxx format right? not the one with the xxxx:xcxx... format?
Yawnder
Yawnder3y ago
[0 to 255]:[0 to 255]:[0 to 255]:[0 to 255]
kami
kamiOP3y ago
ah okay, the ipv6. i was kinda scared of using that one since it seems like most ip addresses i see are in the ipv4 format?
Yawnder
Yawnder3y ago
I think you're making it way more complicated than it needs to be. Take whatever google tells you your IP is. It 99.9% is what you need to use.
kami
kamiOP3y ago
ok, and then the connection string in this format? Data Source=ip,port;Network Library=DBMSSOCN;Initial Catalog=BaseX;User ID=UserX;Password=PasswordX;
Yawnder
Yawnder3y ago
Never used "Network Library", so not sure what it is
kami
kamiOP3y ago
ok! time to test then
Want results from more Discord servers?
Add your server