SubSonic,SQLite和无法找到数据提供商?

时间:2009-12-23 03:23:40

标签: sqlite subsonic dataprovider

我开始使用SubSonic。我想将我的数据库更改为sqlite,我在配置文件中有这个

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

我得到了例外

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.

我在参考部分中有SQLite参考。那么我该如何解决这个问题?

2 个答案:

答案 0 :(得分:4)

如果您正在使用visual studio,请尝试使用服务器资源管理器中的System.Data.SQLite创建数据库连接。如果System.Data.SQLite提供程序不在提供程序列表中,则安装或重新安装它。然后检查您是否可以在visual studio中打开和查看表数据。如果这是有效的,亚音速2.2应该能够使用sqlite文件。我在sonicite中使用了一个更新的亚音速数据提供程序,它位于subsonic的github存储库中,对我来说似乎更好一些。但是,它不会生成多对多代码。

在已部署的应用程序中,您无需单独安装提供程序。

答案 1 :(得分:1)

哪个版本的亚音速?

我的sqlite工作提供程序部分如下所示:

<add name="Local" type="SubSonic.SQLiteDataProvider, SubSonic" connectionStringName="MyConn" generatedNamespace="X.Data" stripTableText="tbl" />

我的连接字符串看起来像

<add name="MyConn" connectionString="Data Source=C:\data.db;Version=3;"/>

希望这会有所帮助: - )

相关问题