Sql – SubSonic, SQLite and Unable to find Data Provider

dataprovidersqlitesubsonic

I am getting started with SubSonic. I wanted to change my db to sqlite and i have this in my config file

  <connectionStrings>
      <add name="NorthwindSQLite"
       connectionString="Data Source=C:\unzipped\WindowsFormsApplication1\my.db"
       providerName="System.Data.SQLite"/>
  </connectionStrings>

I get the exception

A first chance exception of type 'System.ArgumentException' occurred in System.Data.dll

Additional information: Unable to find the requested .Net Framework Data Provider.  It may not be installed.

I have the SQLite Reference in the reference section. So how do i correct this problem?

Best Answer

If you are working with visual studio, try to create a db connection using System.Data.SQLite in the server explorer. If System.Data.SQLite provider is not in the list of providers, then install or reinstall it. Then check that you can open and view table data in visual studio. If this is working, subsonic 2.2 should be able to work with a sqlite file. I use a newer subsonic data provider for sqlite that is in subsonic's github repository that seems to work a little better for me. It doesn't generate many-to-many code however.

In a deployed application you will not have to install the provider separately.