12

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

Community
  • 1
  • 1
Mike
  • 5,560
  • 12
  • 41
  • 52
  • to be clear the SQL server client option exists within "Web Developer 2010 Express" as you would expect.. enter/select server, credentials and db then away you go –  Dec 14 '11 at 16:39

2 Answers2

1

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

SLaks
  • 868,454
  • 176
  • 1,908
  • 1,964
  • 3
    Where do you change the connection string? – User Jan 12 '11 at 23:19
  • this does not actually answer the question.. are you saying create another connection and then change the connection sting the in the app.config? can you actually connect to a running sql server instance without attaching a .mdf file –  Dec 14 '11 at 16:20
  • @gordatron: Yes, you can. I'm not sure what you're asking. – SLaks Dec 14 '11 at 16:38
  • 2
    well in VS pro & web developer you can connect to an SQL instance as posted by OP.. however in c# express you can only select a file exactly as OP shows. I am asking: are you saying create a file and attach it to a local instance of sqlexpress. then change the connection string somewhere to connect to the actual db you want to connect to? if so where do you change it? it is disabled through right clicking on the connection and selecting properties –  Dec 14 '11 at 16:47
  • 1
    I never used VS Express, so I'm not sure. You should be able to change the connection string in App.config. – SLaks Dec 14 '11 at 16:51
  • i am not sure how to get it in the app.config.. its been a few months since I used pro but there is no direct equivalent of the option to store the connection string in the app.config –  Dec 14 '11 at 18:11
  • @Milox where are you changing the connection string? –  Dec 21 '11 at 14:28
  • I'm changing it in my front end layer (Console application) and my data layer (to update model from SQL Server Express data base), both of these projects use App.config to store the conneciton string – Juan Jimenez Dec 21 '11 at 16:27
0

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.

robaker
  • 1,028
  • 7
  • 11