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