Data provider required to connect to local data file could not be found

浪子不回头ぞ 提交于 2019-12-25 02:24:26

问题


I am using Visual Studio 2010 ultimate edition and i install it with full components.

Now i working on win form project in which i need to include a local database so whenever i am trying to add local database file(mydata.sdf) in my project then a box comes showing this message:

Data provider required to connect to local data file could not be found.The file will be added to project but the typed dataset associated with the file will not be generated.

So please suggest me how can i solve this problem?

-Thanks


回答1:


The sdf file extension is used for SQL Server Compact Edition databases. You need to download and install the support for this separately from visual studio.

Here is a link to the MSDN documentation for this.

Note that tooling support was not added to Visual Studio 2010 until SP1.




回答2:


I see this question is years old, but the same problem just happened to me, so I'd like to pass this on:

I'm using Visual C# 2010 Express and was not able to add a Local Database (database1.sdf), although it worked before.

This is on Windows 7, which over the last few months I've made numerous backup system images.

I searched many Google hits for the error message, and found none that worked. I followed the instructions posted on this page, but they did not work either.

I've been working on this off and on for a week.

Finally I was reminded that a .sdf database is a SQL CE database .... I opened a new Project and immediately went to Data, Add New Data Source .. and then clicked through the screens until I got to "Choose your Data Connection" which was blank.

I clicked New Connection, and then the Change button, and noticed that "Microsoft SQL Server Compact 3.5" was not in the list.

From the Google searches I had done, I remembered that Compact 3.5 was supposed to be included with the normal installation of C# Express.

Then I went to my saved system images and restored an image of this computer from March of this year. (before I first installed C# Express)

I uninstalled everything in Control Panel, Programs and Features that looked like it had anything to do with servers or databases and reinstalled Visual C# 2010 Express.

Now Compact 3.5 is once again in the selections for Data Sources, and .sdf databases attach normally.

The Help, About file in Express says this is Microsoft Visual Studio 2010, version 10.0.30319.1 RTMRel, but does not say anything about SP1.

If it is SP1, it isn't showing it ... but .sdf works just fine now!

Advice to anyone having the same problem: save your important stuff then uninstall everything, and reinstall.

The last window during the C# installation will report if it installed successfully or not. Mine did this time, but earlier tries had errors.

But it's working now ...




回答3:


In Visual Studio 2008, I faced a similar problem. I dealt with it by installing SSCEVSTools-ENU.msi separately. More reading here. What I'm trying to say is, find the installer related to SQL Compact edition tools for your IDE in the DVD and install it. If it doesn't work, install anything related to SQL in the DVD.




回答4:


For me helped to uninstall all Visual Studio 2012 and 2013 solutions and then install VS12 Express for Web back. I think the problem was with proper files and extensions sharing between different versions of VS. Hope this helps!



来源:https://stackoverflow.com/questions/8372969/data-provider-required-to-connect-to-local-data-file-could-not-be-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!