从 Visual Studio 2008 连接到 SQLite 数据库

发布于 2024-08-18 06:06:02 字数 542 浏览 2 评论 0原文

我过去确实编写了一些使用 sqlserver 数据库访问的应用程序。然而,这些数据库带有向导来帮助您创建与其的连接。

现在,我想在 Visual Studio 2008 的服务器资源管理器中向 SQLite 添加一个新的数据库连接。我引用了 phxsoftware 中的 System.Data.SQLite 程序集。我可以选择 SQLite 数据库文件(SQLite 的 .NET Framework 数据提供程序)作为数据源。然后我尝试添加作为连接字符串:Data Source=g:\testsqlite.s3db; Version=3(我使用 SQLite 管理员构建的数据库文件)。

当我点击“测试连接”按钮时,一切似乎都很好,但是当我点击“确定”时,Visual Studio 会向我显示一个消息框,指出 .Net Framework Dataprovider for Sqlite 中发生了意外错误。

我做错了什么?

I did write some apps in the past that used access en sqlserver databases. These databases come with wizards however to help you create a connection to it.

Now, I want to add a new db connection in the Server explorer of visual studio 2008 to SQLite. I referenced the System.Data.SQLite assembly from phxsoftware. I am able to select the SQLite Database File (.NET Framework Data Provider for SQLite) as a Datasource. Then I tried to add as the connection string: Data Source=g:\testsqlite.s3db; Version=3 (a database file I constructed using SQLite administrator).

When I hit the Test Connection button all seems to be fine, but when I hit OK, visual studio greets me with a message box that an unexpected error has occurred in the .Net Framework Dataprovider for Sqlite.

What am I doing wrong?

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

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

发布评论

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

评论(3

记忆で 2024-08-25 06:06:02

这个问题在这里讨论 Jaap34的答案解决了我的问题案件。实际上,当您看到一个屏幕仅提供输入连接字符串的选项时,您就知道遇到了不兼容问题。卸载 sqlite ADO 提供程序、运行 devenv.exe /resetuserdata 并重新安装 ADO 提供程序将为您提供一个更详细的屏幕,使您可以浏览到数据库文件。

The question is discussed here Jaap34's answer solved the problem in my case. Actually when you see a screen that gives you only the option to enter a connection string you know you have run into an incompatibility issue. Uninstalling sqlite ADO provider, running devenv.exe /resetuserdata and reinstalling the ADO provider will give you a much more elaborate screen that gives you the possibility to browse to the database file.

三人与歌 2024-08-25 06:06:02

安装 SQLite 后,只需重新启动 Visual Studio。

After your SQLite installation just restart your Visual Studio.

自此以后,行同陌路 2024-08-25 06:06:02

执行以下解决方案以重置以前的设置。

在网上查了好久,找到了很多不同的答案后,我终于成功了。这是我的解决方案:

  1. 关闭所有打开的 Visual Studio 实例。
  2. 通过导航到“开始\所有程序\附件”,右键单击“命令提示符”并选择“以管理员身份运行”,在管理员上下文中打开命令提示符。
  3. 导航到 VS2008 的安装路径 - 在我的例子中(Vista x64 上默认)是 C:\Program Files (x86)\Microsoft Visual Studio 2008 9.0\Common7\IDE
  4. 运行命令 devenv /setup 。这需要一点时间,但要有耐心。
  5. 启动 Visual Studio。

执行这些步骤后,设置将重置为默认值,因此您必须重新配置所有启动选项、文本编辑器的字体等。这可能可以通过运行 devenv /resetskippkgs 来帮助,但是它没有在我的设备上尝试这样做。机器。

Do the following for a soloution to reset the previous settings.

After looking back and forth over the internet, coming across a lot of different answers, I finally managed to get this working. This was my solution:

  1. Close all open instances of Visual Studio.
  2. Open the Command Prompt in an Administrator context by navigating to Start\All Programs\Accessories, right-clicking Command Prompt and choosing Run as Administrator.
  3. Navigate to the install path of VS2008 - in my case (default on Vista x64) it was C:\Program Files (x86)\Microsoft Visual Studio 2008 9.0\Common7\IDE
  4. Run the command devenv /setup. It takes a little while, but be patient.
  5. Start Visual Studio.

After following these steps, the setup is reset to default, so you'll have to reconfigure all startup options, fonts for the text editors etc. This could possibly be helped by running devenv /resetskippkgs instead, however it did not try that on my machine.

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