在使用subsonic 3时,如果不完整安装SQLite的SDK包,直接在项目中使用System.Data.SQLite将引发上述错误。
原因是:是 DBproviderfacotories 没有导致
解决的办法是手动在配制文件中指定 ,代码如下 :
<system.data>
<DbProviderFactories>
<remove invariant= " System.Data.SQLite "/>
<add name= " SQLite Data Provider " invariant= " System.Data.SQLite " description= " .Net Framework Data Provider for SQLite " type= " System.Data.SQLite.SQLiteFactory, System.Data.SQLite " />
</DbProviderFactories>
</system.data>
<remove invariant= " System.Data.SQLite "/>
<add name= " SQLite Data Provider " invariant= " System.Data.SQLite " description= " .Net Framework Data Provider for SQLite " type= " System.Data.SQLite.SQLiteFactory, System.Data.SQLite " />
</DbProviderFactories>
</system.data>
ref: http://www.cnblogs.com/leleroyn/archive/2011/03/24/1993627.html