简体   繁体   中英

Can't add local SQL database to VS2010 project?

I've been reading up and doing exercises in Visual Studio 2010 Professional C# . Everything has worked til' I came across an exercise that asked to create a local SQL database(.sdf). When I add it, it gives me the error message; "The data provider required to connect to the local data file could not be found. The file will be added to the project but the typed DataSet associated with the file will not be generated." It will add the database but whenever I try to access it it gives me another error Message;

"The operation could not be completed. Unspecified error."

At first, I thought it was a matter of reinstalling SQL Server Compact 3.5 SP2 . Tried it and no luck. Not sure what to do from here. :\\

If relevant: Windows XP x32 Visual Studio Professional 2010 SQL server compact 3.5 SP2

Are you using Entity Framework? If so are you doing Code First or Database First coding?

This is an example using MVC3 but is easily transferable to other project models and easy to follow: http://www.asp.net/mvc/tutorials/getting-started-with-aspnet-mvc3/cs/adding-a-model

If you are new to Entity Framework here are some more tutorials to scan through to get what you need: http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc

Try this link. I just started a ASP.NET web application and I have used this article for setting up some entity framework stuff. I really like this so far. I hope this helps.

http://weblogs.asp.net/dotnetstories/archive/2011/03/01/using-stored-procedures-with-entity-framework-in-an-asp-net-application.aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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