SubSonic、SQLite 和无法找到数据提供程序?

发布于 2024-08-15 17:44:21 字数 586 浏览 1 评论 0原文

我正在开始使用 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 参考。那么我该如何纠正这个问题呢?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

总以为 2024-08-22 17:44:21

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

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

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.

别忘他 2024-08-22 17:44:21

哪个版本的亚音速?

我的 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;"/>

希望这有帮助:-)

which version of subsonic?

my working provider section for sqlite looks like below:

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

and my connection string looks like

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

hope this helps :-)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文