Redistributing VistaDB with your product is very easy - just place the appropriate runtime Dll(s) in the same directory as your executable (or in the bin folder of your web project). We don't recommend using the GAC unless absolutely required by your application. All of the libraries used by VistaDB are distributed as NuGet packages, installed in the Packages folder of the VistaDB installation, typically:
C:\Program Files (x86)\Gibraltar Software\VistaDB 6\Packages
Additionally, there are redistributable tools useful in certain scenarios located in a Redist folder in the VistaDB installation, typically:
C:\Program Files (x86)\Gibraltar Software\VistaDB 6\Redist
All of the assemblies in the Packages and Redist folders can be redistributed at no cost. You may not include the Visual Studio Designer DLL's, or the Data Builder. See the EULA for more information.
In nearly every application that uses VistaDB you will need to register the VistaDB Engine with ADO.NET so that it can be found when using Entity Framework or Typed DataSets. This is done through the configuration file for the application. For executables (like WinForms applications, console applications, and services) this is a file called app.config in the root directory of your project. For Web sites it's called web.config.
App.Config with VistaDB Provider Factory |
Copy Code
|
---|---|
<?xml version="1.0" encoding="utf-8"?> <configuration> <connectionStrings> <add name="YourAppConnection" connectionString="Data Source='|DataDirectory|\Database.vdb6'" providerName="System.Data.VistaDB6" /> </connectionStrings> <system.data> <DbProviderFactories> <remove invariant="System.Data.VistaDB6" /> <add invariant="System.Data.VistaDB6" name="VistaDB 6 Data Provider" description="VistaDB 6 ADO.NET Provider for .Net" type="VistaDB.Provider.VistaDBProviderFactory, VistaDB.6" /> </DbProviderFactories> </system.data> </configuration> |
The connection string in the example above specifies a providerName of "System.Data.VistaDB6". This is then resolved in the list of DbProviderFactories by looking for an entry with a matching "invariant" name. When it finds a match it will then load the type specified by the provider factory and ask it to create all of the various objects it needs for data access.
Here is the DbProviderFactory setting:
<add invariant="System.Data.VistaDB6" name="VistaDB 6 Data Provider" type="VistaDB.Provider.VistaDBProviderFactory, VistaDB.6" />
If your application uses Entity Framework see Using VistaDB with Entity Framework - Registering the Provider for additional configuration necessary to register the EF provider with your application.
Once you've shipped your application and are storing real data in it, you want to be sure to keep that data safe and accessible. Follow our suggestions on Database Maintenance to be prepared for whatever can happen in the real world. Taking a little time up front can save a great deal of support time and customer satisfaction later.