Skip to content
Adam Schroder edited this page Nov 13, 2020 · 2 revisions

Sql Server

We have made the decision to switch to Microsoft.Data.SqlClient as this is a direct replacement for System.Data.SqlClient

Brand new project

  1. Add <PackageReference Include="NPoco.SqlServer" Version="5.0.0" /> to your project
  2. Create your own MyDatabase inheriting SqlServerDatabase
  3. Instantiate MyDatabase wherever needed

Existing project*

  1. Replace your NPoco reference with NPoco.SqlServer
  2. Remove references to System.Data.SqlClient if you manually have them.
  3. Add SqlClientFactory.Instance as the 3rd parameter

* if you have already created your own MyDatabase inherit it from SqlServerDatabase instead of Database