System.ArgumentException: 'Keyword not supported: 'trust server certificate'.'

JW 40 Reputation points
2024-09-24T18:52:17.1166667+00:00

When I try to add new data into the SQL table I get this error message.

System.ArgumentException: 'Keyword not supported: 'trust server certificate'.'

SqlConnection con = new SqlConnection("Data Source=JERRY-P720\JW_SQLEXPRESS;Initial Catalog=OSG_Earthquake_Library;Integrated Security=True;Trust Server Certificate=True");

Not sure how to fix the trust error because it is copied exactly from where it tolled me to get it from. Anyone have a suggestion.

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,865 questions
{count} votes

Accepted answer
  1. LucyChenMSFT-4874 4,815 Reputation points
    2024-09-25T02:45:02.3133333+00:00

    Hi @JW,

    Thank you for your reaching out and welcome to Microsoft Q&A!

    The error message 'Keyword not supported: 'trust server certificate' usually caused by connection strings.

    Here is a known thread like yours, please try the following method:

    • Try removing the space in Trust Server Certificate and Multi Subnet Failover.
    • I also had to remove the space between "Application Intent" and make sure to rebuild the application before trying to Run it or it will use the initial spaced string.

    You could also refer to: https://github.com/dotnet/machinelearning-modelbuilder/issues/2899

    Feel free to share your issues here if you have any concerns.

    Best regards,

    Lucy Chen


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    https://docs.microsoft.com/en-us/answers/support/email-notifications


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.