Closed king311247 closed 5 months ago
Looking at the error it seems like the tcp connection between Sql server and the client cannot be established. Have you tried connecting to the server and port using a system utility to see if the network path is ok?
You could try netcat if it is available. netcat -v -z ipaddress port
@saurabh500 I installed the telnet tool on the deployment machine, telnet ipaddress port is successful
it's really can't work on centos when use sqlserver2008 for netcore2.1 . I have use sqlserver2014 to make it work without modify any other thing.
As recently announced in the .NET Blog, focus on new SqlClient features an improvements is moving to the new Microsoft.Data.SqlClient package. For this reason, we are moving this issue to the new repo at https://github.com/dotnet/SqlClient. We will still use https://github.com/dotnet/corefx to track issues on other providers like System.Data.Odbc and System.Data.OleDB, and general ADO.NET and .NET data access issues.
SQL Server 2008 is long out of support and issue can't be repro'd on currently supported SQL versions.
I'm running a webapi project by dotnetcore on centos.but it is failed to connect to MSSQL. In order to find the problem, I try to use the telnet to determine whether the server port, try to find the next is normal, and the project in the Windows environment are successful, the database can be connected, but deployed to centos is not connected to the database.
Error like this: Microsoft.AspNetCore.Server.Kestrel[13] Connection id "0HL30IKDGRVD6": An unhandled exception was thrown by the application. System.Data.SqlClient.SqlException: 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: 35 - An internal exception was caught) ---> System.AggregateException: One or more errors occurred. (No such device or address) ---> System.Net.Internals.SocketExceptionFactory+ExtendedSocketException: No such device or address
Connection string example: Data Source=192.168.1.5\SQLSERVER2008;Initial Catalog=AwardSysDB;User ID=xx;Password=xx;min pool size=100;max pool size=250;
Data Source=192.168.1.5,1435;Initial Catalog=AwardSysDB;User ID=xx;Password=xx;min pool size=100;max pool size=250;