Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Microsoft.Data.SqlClient #513

Closed
matteoscaramuzza opened this issue May 14, 2024 · 2 comments
Closed

Microsoft.Data.SqlClient #513

matteoscaramuzza opened this issue May 14, 2024 · 2 comments

Comments

@matteoscaramuzza
Copy link

Hi @jonwagner, I see you've released a new version of this package and I've seen that it still uses System.Data.SqlClient instead of the new Microsoft.Data.SqlClient (https://devblogs.microsoft.com/dotnet/introducing-the-new-microsoftdatasqlclient/, dotnet/SqlClient#1963, https://github.com/dotnet/SqlClient/blob/main/porting-cheat-sheet.md) and I was wondering if there is a specific reason for this choice.

I've tried to fork and migrate from System.Data.SqlClient to Microsoft.Data.SqlClient and I haven't encountered any problem.
The only breaking change was that I needed to add to the connection string the option TrustServerCertificate=True.

Let me know please.

Thank you

@jonwagner
Copy link
Owner

There is an Insight provider for both drivers:

  • Insight.Database.Providers.MsSqlClient.SqlInsightDbProvider for the new Microsoft.Data.SqlClient.
  • Insight.Database.Providers.Default.SqlInsightDbProvider for the legacy System.Data.SqlClient.

We did not change the implementation of the original provider in order to preserve compatibility with old code. However, in v8.0 we did switch the packaging so that the provider for Microsoft.Data.SqlClient is installed by default instead of the legacy one.

So you can just add the Insight.Database package and you will be using the Microsoft.Data.SqlClient provider by default.

@matteoscaramuzza
Copy link
Author

matteoscaramuzza commented May 14, 2024

Sorry, I didn't notice that Insight.Database.Providers.MsSqlClient.SqlInsightDbProvider references Microsoft.Data.SqlClient.

Thank you for the quick reply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants