Home > Net >  SQLClient connect the SQL Server error: because of different algorithms, the client and the Server c
SQLClient connect the SQL Server error: because of different algorithms, the client and the Server c

Time:10-27

I have a DLL, there is a process is used to insert into the database log tables log, the code is as follows:
 
Const string linkString="Data Source=172.31.1.2; Initial Catalog=RPADashboard; Persist Security Info=True; User ID=RPADashboardDev; Password=Password; MultipleActiveResultSets=true ";

Public void Log (string projectCode, string info, string tCode="", string entity=" ", string taskName="")
{
System.Net.ServicePointManager.SecurityProtocol=SecurityProtocolType. Tls12;

String SQL="INSERT INTO PROJECT_LOG (StepTime, BotName, ProjectCode StepInfo, TCode, Entity, TaskName)";
SQL +="VALUES (GETDATE (), '" + Environment. The UserName. The ToUpper () +"', '" + projectCode + "', '" + info. Replace ("' ", "" '") +"', ".
SQL +="'" + (tCode=="-"? "" : tCode) +" ', '" + (entity=="-"? "" : the entity) +" ', '" + (taskName=="-"? "" : taskName) +" ') ";
SqlConnection conn=new SqlConnection (linkString);
Conn. The Open ();
SqlCommand CMD=new SqlCommand (SQL, conn);
CMD. ExecuteNonQuery ();
Conn. Close ();
}

Client Windows 7, WIN10 cases, calls are no problem, but now there is a new client, the system is a Windows Server 2012 R2 Datacenter, run on the client machine, will be an error:
Error Description: a connection with the server has been successfully established, but an Error occurred during the login process, (SSL provider, the provider: Error: 0 - because the algorithm is different, the client and the server can't communicate,)
Then I added in the connection string: Encrypt=True; TrustServerCertificate=True; But the result is still the same, my SQL Server Server version is SQL Server 2008 R2, enabled TLS1.2, but don't know why not from a trip to the Windows Server 2012? How should the screening?
  •  Tags:  
  • C#
  • Related