从 Visual Studio 2008 连接到 SQLite 数据库
我过去确实编写了一些使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这个问题在这里讨论 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.
安装 SQLite 后,只需重新启动 Visual Studio。
After your SQLite installation just restart your 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:
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.