✅ System.ArgumentException: 'Keyword is not supported: 'trust server certificate'.'
Hi,
I am trying to build a project which takes the input from the user and adds into SQL Server,
I normally entered my data source directory but it is giving me error, how do I fix it? (It says what is on the title)
11 Replies
Does changing to Microsoft.Data.SqlClient fix it?
Microsoft.Data.SqlClient 5.2.0
The current data provider for SQL Server and Azure SQL databases. This has replaced System.Data.SqlClient. These classes provide access to SQL and encapsulate database-specific protocols, including tabular data stream (TDS).
Commonly Used Types: Microsoft.Data.SqlClient.SqlConnection Microsoft.Data.SqlClient.SqlException Microsoft.Data.SqlC...
Commonly Used Types: Microsoft.Data.SqlClient.SqlConnection Microsoft.Data.SqlClient.SqlException Microsoft.Data.SqlC...
The System.Data.SqlClient is old and legacy.
how do I install/use it
Sorry I am a beginner
Are you using Visual Studio?
Yes
Right click on your project, you should see a Manage NuGet Packages option.
Click the Browse tab, type in
Microsoft.Data.SqlClient
You can then click the Install button.
After that, replace
using System.Data.SqlClient
in your code with using Microsoft.Data.SqlClient
and try again.Oh manage to do it, thank you so much for help!
Unknown User•8mo ago
Message Not Public
Sign In & Join Server To View