所选对象使用了不受支持的数据库提供程序 [英] The selected object(s) use an unsupported database provider

查看:227
本文介绍了所选对象使用了不受支持的数据库提供程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Visual Studio 2010
在我的项目中,我添加了本地数据库Data.sdf
现在我想将它与LINQ TO SQL一起使用,但是当我将数据库表拖放到LINQ设计器中时,在Visual Studio中出现以下错误:

"The selected object(s) use an unsupported database provider"

I'm using Visual Studio 2010
In my project I was added a local database Data.sdf
Now I wanna use LINQ TO SQL with it, but when I drag and drop the database table into the LINQ designer , I get the following error in Visual Studio :

"The selected object(s) use an unsupported database provider"

我想念什么吗?
我该如何解决?

Am I miss something ?
How can I fix it ?

推荐答案

仅当与完整版本的Microsoft SQL Server(包括Express版本)一起使用时,才正式支持LINQ-to-SQL.尽管可以将它与SQL Server CE(您正在尝试做的事情)一起使用,但还有其他一些步骤,但还需要额外的步骤.

LINQ-to-SQL is only officially supported when used with a full version of Microsoft SQL Server (including Express editions). While it's possible to use it with SQL Server CE (which is what it appears you're trying to do) and some others, extra steps are required.

您可以:

  • 使用 SqlMetal.exe 生成.dbml文件,然后将其加载到项目中(假设您使用的是SQLCE 3.5;它似乎不适用于4.0)
  • 在本地计算机上的SQL Server Express数据库中保留数据库架构的相同副本.将其用于设计工作,然后在运行时连接到SQL CE数据库.
  • Use SqlMetal.exe to generate your .dbml file, then load it into your project (assuming you're using SQLCE 3.5; it doesn't appear to work with 4.0)
  • Keep an identical copy of your database schema in a SQL Server Express database on your local machine. Use that for design work, then connect to your SQL CE database at runtime.

这篇关于所选对象使用了不受支持的数据库提供程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆