Installing Insight - kevinsea/Insight.Database GitHub Wiki

It's easy to get started with Insight.Database.

  1. Add Insight.Database Nuget Package to your project. From the Package Manager Console its:

    PM> Install-Package Insight.Database

  2. If you're using a database other than SQL Server, get the proper provider package (e.g. Insight.Database.Providers.MySql.

  3. Import the extensions into your code by adding using Insight.Database;

  4. Register the provider for your database (see below).

  5. Write code.

Registering a Provider

Insight will attempt to auto-register any provider DLLs it finds in your application search path or in the same folder as the Insight.Database assembly.

However, for some project configurations (e.g. add-ins or class libraries created in another folder), auto-registration may fail to find the provider assembly. You'll get an exception that says:

Have you loaded the provider for your database?

If you get this in your project, you can force Insight to load a particular provider by calling the RegisterProvider method on the database provider.

For example:

using Insight.Database;

// at some point in application startup...
SqlInsightDbProvider.RegisterProvider();

Or:

using Insight.Database.Providers.MySql;

// at some point in application startup...
MySqlInsightDbProvider.RegisterProvider();

See Insight and Data Providers for the list of providers. And see Hello World if you are ready to run some code.