siby sunny siby sunny - 4 months ago 38
C# Question

Remote DB connection string failed

I need to connect the db on another system. while i tried the connection string as

SqlConnection con = new SqlConnection(@"Data Source=(\SQLEXPRESS,1433;Network Library=DBMSSOCN;Initial Catalog=db_Stock;Integrated Security=True;Connect Timeout=15;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False";

error shown:

"A network-related or instance-specific error occurred while
establishing a connection to SQL Server. The server was not found or
was not accessible. Verify that the instance name is correct and that
SQL Server is configured to allow remote connections. (provider: TCP
Provider, error: 0 - No such host is known.)"


i fixed the issue by following the below site and instructions

link to the site]site