How to connect to SqlExpress for Entity Framework using Visual Studio 2010 Express?

牧云@^-^@ 提交于 2019-12-19 05:18:29

问题


I'm trying to use the Visual Studio 2010 Express editions to set up an ASP.NET MVC 2 Web Application using SqlExpress + Entity Framework as the data access. I have both the "C# Edition" and "Web Developer Edition" installed.

If I try to add a data source using the "C# edition", I'm missing the "Microsoft SQL Server" data source type.

Visual Studio 2010 Express Screenshot http://dl.dropbox.com/u/4163528/images/StackOverflow/2010Express.png

but Visual Studio 2008 Professional has it.

Visual Studio 2008 Professional Screenshot http://dl.dropbox.com/u/4163528/images/StackOverflow/2008Professional.png

as noted by another StackOverflow question, the "Web Developer Edition" has this. However, the Web Developer Edition doesn't support the Entity Framework items: EntityFramework http://dl.dropbox.com/u/4163528/images/StackOverflow/2010EF.png.

I'd want to stick with only the Express Editions. Is my use case one that Microsoft forgot about? What can I do here to use SqlExpress + MVC 2 + Entity Framework?

Thanks!

-Mike


回答1:


You should be able to select SQL Server Database File, then change the connection string to connect to SqlExpress.




回答2:


I just ran into this same problem. Visual Studio C# Express 2010 SP1 only offers me Microsoft SQL Server Compact 3.5 and Microsoft SQL Server Database File when creating or updating ADO.NET Entity Data Model (*.edmx) files.

However my copy of Microsoft Visual Web Developer 2010 Express SP1 is allowing me to add and update ADO.NET Entity Data Model (*.edmx) files in existing solutions and is allowing me to choose the Microsoft SQL Server option when building connection strings.

So the workaround for me is to simply switch between C# & Web Developer when messing with connection strings. Not sure if that's out-of-the-box for everybody or whether I've installed something else that switched the Microsoft SQL Server option on in Web Developer.



来源:https://stackoverflow.com/questions/2710654/how-to-connect-to-sqlexpress-for-entity-framework-using-visual-studio-2010-expre

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