VS2022 connecting to SQLServer 2014 Database

Discussion in 'General MSSQL Discussion' started by tim8w, Mar 11, 2022.

  1. tim8w

    tim8w

    Joined:
    Feb 23, 2021
    Messages:
    3
    Likes Received:
    1
    Hi,
    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?
     
    tim8w, Mar 11, 2022
    #1
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.