I have a C # application that works locally, but it does not work if I publish my program on another machine. I get a message that the server name was not found.
An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in ProductionOrderQuery.exe
Additional information: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or is unavailable. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (vendor: SQL Network Interfaces, error: 26 - Troubleshooting the specified server / instance)
Both machines are in the same corporate domain network. could this be due to the way i specify the name of my server? Do I just need to write the server name or do I need a fully qualified domain name?
Connection string
Server=hostname\\SQLEXPRESS;Database=mydb;Trusted_Connection=True;
I am using SS auth with sa account.
Do I need to do anything on SSMS to get this to work?
Edit: So, since the instructions for connecting through the IP address have been followed to check if this is encrypted with DNS. I configured named pipes and static ports and changed the connection string. Firewall is disabled. Unable to connect remotely, everything works fine locally. I managed to get one machine to connect remotely, and this is very puzzling.
New Connection String - Data Source =
<ip>,1433; Network Library = DBMSSOCN;Initial Catalog = footfall; User ID = sa; Password=password;connection timeout=0;
ping- im, , nslookup . . .
2: - , , . , , - Windows, , SA. , .
: , , combobox , .
VS, . , .
, , , .
SA ( perms ), .
, sa ( , ), , .
, , 2 , , SA ,
.