12

我試圖使用Visual Studio 2010 Express版本來設置一個使用SqlExpress + Entity Framework作爲數據訪問的ASP.NET MVC 2 Web應用程序。我安裝了「C#版」和「Web開發人員版」。如何使用Visual Studio 2010 Express連接到SqlExpress for Entity Framework?

如果我嘗試使用「C#版本」添加數據源,我缺少「Microsoft SQL Server」數據源類型。

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

但Visual Studio 2008專業有它。

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

由另一StackOverflow的問題,the "Web Developer Edition" has this指出。但是,Web開發人員版不支持實體框架項目: EntityFramework http://dl.dropbox.com/u/4163528/images/StackOverflow/2010EF.png

我想堅持只有快捷版。我的用例是微軟忘了嗎?我可以在這裏使用SqlExpress + MVC 2 + Entity Framework做什麼?

謝謝!

-Mike

+0

要清除「Web Developer 2010 Express」中存在的SQL Server客戶端選項,如您所期望的那樣。輸入/ select服務器,憑據和db然後遠離您去 – gordatron 2011-12-14 16:39:41

回答

1

您應該能夠選擇SQL Server Database File,然後更改連接字符串連接到SQLEXPRESS。

+3

您在哪裏更改連接字符串? – User 2011-01-12 23:19:32

+0

這實際上並沒有回答這個問題..你是說創建另一個連接,然後改變連接sting在app.config?你真的可以連接到正在運行的SQL服務器實例,而無需附加.mdf文件 – gordatron 2011-12-14 16:20:30

+0

@gordatron:是的,你可以。我不確定你在問什麼。 – SLaks 2011-12-14 16:38:46

0

我剛碰到這個相同的問題。 Visual Studio C#Express 2010 SP1在創建或更新ADO.NET實體數據模型(* .edmx)文件時僅向我提供Microsoft SQL Server Compact 3.5和Microsoft SQL Server數據庫文件。

但是,我的Microsoft Visual Web Developer 2010 Express SP1副本允許我在現有解決方案中添加和更新ADO.NET實體數據模型(* .edmx)文件,並允許我在構建時選擇Microsoft SQL Server選項連接字符串。

因此,對我來說,解決方法是簡單地在C#& Web開發者之間切換連接字符串。不知道這對每個人來說都是開箱即用的,或者我已經安裝了其他在Web Developer中切換Microsoft SQL Server選項的其他內容。

相關問題