C
C#7mo ago
RXPHXEL

✅ 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)
No description
11 Replies
mtreit
mtreit7mo ago
Does changing to Microsoft.Data.SqlClient fix it?
mtreit
mtreit7mo ago
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...
mtreit
mtreit7mo ago
The System.Data.SqlClient is old and legacy.
RXPHXEL
RXPHXELOP7mo ago
how do I install/use it Sorry I am a beginner
mtreit
mtreit7mo ago
Are you using Visual Studio?
RXPHXEL
RXPHXELOP7mo ago
Yes
mtreit
mtreit7mo ago
Right click on your project, you should see a Manage NuGet Packages option. Click the Browse tab, type in Microsoft.Data.SqlClient
mtreit
mtreit7mo ago
You can then click the Install button.
No description
mtreit
mtreit7mo ago
After that, replace using System.Data.SqlClient in your code with using Microsoft.Data.SqlClient and try again.
RXPHXEL
RXPHXELOP7mo ago
Oh manage to do it, thank you so much for help!
Unknown User
Unknown User7mo ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server