简体   繁体   English

SQL Server Compact 4.0 DbProvider - 没有

[英]SQL Server Compact 4.0 DbProvider - No

I'm using the SQL Server Compact/SQLite Toolbox for Visual Studio by ErikEJ. 我正在使用ErikEJ的Visual Studio的SQL Server Compact / SQLite工具箱。 Environment is Windows 7 x64 with Visual Studio 2013.5 环境是带有Visual Studio 2013.5的Windows 7 x64

I'm following along in the example on the blog http://erikej.blogspot.dk/2013/11/entity-framework-6-sql-server-compact-4_25.html but when I get to 我正在博客http://erikej.blogspot.dk/2013/11/entity-framework-6-sql-server-compact-4_25.html的示例中跟进,但是当我到达

" ... connect to the database file in your project folder:", “...连接到项目文件夹中的数据库文件:”,

I right click to "Add SQL Server Compact/SQLite Connection" and the box comes up, but at the bottom is in red 我右键单击“添加SQL Server Compact / SQLite连接”,框出现,但底部是红色

"Cannot save this connection for use with EF6 Tools, make sure the SQL Server Compact DbProvider is installed, and possibly restart Visual Studio" “无法保存此连接以与EF6 Tools一起使用,请确保已安装SQL Server Compact DbProvider,并可能重新启动Visual Studio”

I go back and click on the About button and get 我回去点击“关于”按钮然后开始

SQL Server Compact 4.0 in GAC - Yes - 4.0.8482.1 
SQL Server Conpact 4.0 DbProvider - No

SQL Server Compact 4.0 DDEX provider - No 
SQL Server Compact 4.0 Simple DDEX provider - Yes
SQL Server Compact 4.0 Engine Test: PASS!

I've uninstalled SQL Server Compact and the SQL Server Compact Toolbox and reinstalled both but I still have the same error. 我已经卸载了SQL Server Compact和SQL Server Compact Toolbox并重新安装了这两个,但我仍然有同样的错误。

I'm wondering how do I get SQL Server Compact 4.0 DbProvider to be yes? 我想知道如何让SQL Server Compact 4.0 DbProvider成为是的?

Thanks 谢谢

Edit I've added the details of the relevant part of machine.config that could contain invalid entries. 编辑我已添加了包含无效条目的machine.config相关部分的详细信息。

<system.data>
    <DbProviderFactories>
        <add name="Odbc Data Provider" invariant="System.Data.Odbc" description=".Net Framework Data Provider for Odbc" type="System.Data.Odbc.OdbcFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
        <add name="OleDb Data Provider" invariant="System.Data.OleDb" description=".Net Framework Data Provider for OleDb" type="System.Data.OleDb.OleDbFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
        <add name="OracleClient Data Provider" invariant="System.Data.OracleClient" description=".Net Framework Data Provider for Oracle" type="System.Data.OracleClient.OracleClientFactory, System.Data.OracleClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
        <add name="SqlClient Data Provider" invariant="System.Data.SqlClient" description=".Net Framework Data Provider for SqlServer" type="System.Data.SqlClient.SqlClientFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
        <add name="Microsoft SQL Server Compact Data Provider 4.0" invariant="System.Data.SqlServerCe.4.0" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"/></DbProviderFactories>
</system.data>

I've checked the above against an example here https://developer.teradata.com/blog/netfx/2010/12/dbproviderfactories-demystified and I can't see anything obviously wrong with that part. 我在上面的示例中检查了上面的示例https://developer.teradata.com/blog/netfx/2010/12/dbproviderfactories-demystified ,我看不出任何明显错误的部分。

Aha. 啊哈。 I was looking in the wrong place. 我在找错了地方。 Under C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\Config I have 在C:\\ Windows \\ Microsoft.NET \\ Framework \\ v4.0.30319 \\ Config我有

<system.data>
    <DbProviderFactories><add name="Microsoft SQL Server Compact Data Provider 4.0" invariant="System.Data.SqlServerCe.4.0" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"/></DbProviderFactories>
</system.data>

hmmm ... the other ones are missing. 嗯......其他的都不见了。

OK, I've finally managed to get past this point. 好的,我终于设法超越了这一点。

I uninstalled Visual Studio 2013 and SQL Server Express. 我卸载了Visual Studio 2013和SQL Server Express。 I had done this before using the procedure listed here https://dba.stackexchange.com/questions/68373/how-to-uninstall-sql-server-2012-not-showing-in-control-panels-programs-and-fe for the sql server and here How to completely uninstall Visual Studio 2010? 在使用此处列出的程序之前,我已经这样做了https://dba.stackexchange.com/questions/68373/how-to-uninstall-sql-server-2012-not-showing-in-control-panels-programs-and- fe for sql server and here 如何完全卸载Visual Studio 2010? using 运用

D:\vs_community.exe /uninstall /force

I had done this before and reinstalled VS2013.5 but I came up with the above error which prompted this question. 之前我已经完成了这个并重新安装了VS2013.5但是我想出了上面的错误,这引发了这个问题。 So following further advice from the above pages I did 因此,根据上述页面的进一步建议,我做了

wmic product where "name like 'microsoft visual studio%'" call uninstall /nointeractive
wmic product where "name like 'microsoft sql server%'" call uninstall /nointeractive

This cleared out stuff that had been left behind from before. 这清除了之前遗留下来的东西。

I also uninstalled using Revo Uninstaller and used that to scan for any remaining traces on the machine. 我还使用Revo Uninstaller卸载并使用它来扫描机器上的任何剩余痕迹。 This also picked up remnants that had been left behind. 这也捡到了遗留下来的遗留物。

After all that, I installed VS2013.5 again and I was able to have SQL Server Compact Toolbox recognize the database properly without error. 毕竟,我再次安装了VS2013.5,我能够让SQL Server Compact Toolbox正确识别数据库而不会出错。 I hope this helps anyone else who comes across the same problem. 我希望这可以帮助遇到同样问题的其他人。

I know, this is an old quest but may be this helps somebody. 我知道,这是一个古老的任务,但可能对某人有所帮助。

I had similar issue, I got 我得到了类似的问题

Cannot save this connection for use with EF6 Tools, make sure the SQL Server Compact DbProvider is installed, and possibly restart Visual Studio 无法保存此连接以与EF6 Tools一起使用,请确保已安装SQL Server Compact DbProvider,并可能重新启动Visual Studio

And as a result could not connect DataGrid component to the Database. 因此无法将DataGrid组件连接到数据库。 In this case just dont forget about pretty cool button Register DDEX Providers provided by ErikEJ (many thanks to him) 在这种情况下,不要忘记ErikEJ提供的很酷的按钮注册DDEX提供商 (非常感谢他)

在此输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM