Having issue with Keyword not supported: 'trust server certificate in Visual Studio VB

Chaim Bochner 5 Reputation points
2023-04-03T21:57:11.6966667+00:00

Hi. I'm trying to run VB code in visual studio form project but get an error when code is trying to run. Error is: "System.ArgumentException: 'Keyword not supported: 'trust server certificate'.'". The line in code affected is: "Using connection As New SqlConnection(My.Settings.ConnString)". My data source is "Data Source=(localdb)\MSSQLLocalDB;Initial Catalog="C:\CHAIM\STUDIO SAMPLE PROJECT\SAMPLEDATABASEWALKTHROUGH\SALES.MDF";Integrated Security=True;Connect Timeout=30;Encrypt=False;Trust Server Certificate=False;Application Intent=ReadWrite;Multi Subnet Failover=False" No luck trying ANYTHING suggested. I have windows 10 64bit on old laptop. Please assist. Thanks

VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,668 questions
Visual Studio Debugging
Visual Studio Debugging
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Debugging: The act or process of detecting, locating, and correcting logical or syntactical errors in a program or malfunctions in hardware. In hardware contexts, the term troubleshoot is the term more frequently used, especially if the problem is major.
967 questions
{count} vote

1 answer

Sort by: Most helpful
  1. Jiachen Li-MSFT 29,106 Reputation points Microsoft Vendor
    2023-04-04T01:25:20.19+00:00

    Hi @Chaim Bochner ,

    Try removing the space in Trust Server Certificate and Multi Subnet Failover.

    Best Regards.

    Jiachen Li


    If the answer is helpful, please click "Accept Answer" and upvote it.

    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.

    9 people found this answer helpful.