Well first off, SQLite doesn't support automatic database creation, you have to manually create the database. So I added that add-in to my Firefox and created the database. I'm wondering if this is worth the time. This program uses old Dbase IV or Foxpro database files, and I wanted to use something faster and more modern for a new program feature that stores all the emails sent in the database, so if one fails it can be resent. This kicked my butt, but I don't get an error anymore. I couldn't figure out the App.Config part the way the bulk of examples showed, but I did figure out how to point the database to a network drive via code in the Application, and pass it to EF6 DAL. So in case your looking for an example of how to point SQLite to a network drive without hard coding the path, this is it, well I think it is, until something better comes along. I apologize in advance for this being in VB. All the examples where in C# My project has 3 modules, because it's getting too large in size. Main Project EXE Data Access Layer DLL Entity DLL I went back and stripped out the SQLite from the main project and Entity DLL and just installed it in the DAL DLL. Then just made references for SQLite back to the DAL. Then stripped out the SQLite and EF stuff in the App.Configs of DLL's So in the DBContext class in my DAL, I added the conn string to use in New()
Public Class ameContext
Inherits DbContext
Public Shared Property DefaultConnectionFactory As IDbConnectionFactory
Public Sub New(ByVal conString As String) '<< I added the conn string to use
MyBase.New(conString)
'SQLite doesn't support auto database creation
Entity.Database.SetInitializer(Of ameContext)(Nothing)
End Sub
End NameSpace
Then I added a SQLiteConfiguration File to my DAL Class, which gets called from the DBContext above.
Imports System.Data.SQLite
Imports System.Data.SQLite.EF6
Imports System.Linq
Imports System.Text
Imports System.Data.Entity.Core.Common
Imports AccountMate_DAL
Namespace System.Data.SQLite.Entity
Public Class SQLiteConfiguration
Inherits DbConfiguration
Public Sub New()
SetProviderFactory("System.Data.SQLite", SQLiteFactory.Instance)
SetProviderFactory("System.Data.SQLite.EF6", SQLiteProvid