We currently have a 2014 SQL Server Database that we currently are connecting to using VS2012. The code we are using comes from the older 4.5 .Net libraries System.Data.SQLClient. The following is the code it's using:
SqlConnection conn = new SqlConnection(); conn.ConnectionString = "Data Source=la04sqlpres01;Initial Catalog=FPY;User ID=UserName;Password=password"; conn.Open();
I tried using the same code with the new VS2022 .Net 6.0 library Microsoft.Data.SQLClient. When it tries to execute the conn.Open command it gets the following error:
Error: A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - The certificate chain was issued by an authority that is not trusted.)
Anyone have any idea what the ConnectionString needs to be now or what the new code might look like?