Home

Cannot connect to Contoso University Entity Framework MVC5 tutorial.

Hi Joe or anyone

I am working my way through the ASP.NET MVC Contoso University tutorial and am up to...
http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/creating-a-more-complex-data-model-for-an-asp-net-mvc-application

(MVC5 Entity Framework V6.1.0 Code First)

About 2/3rds of the way down the page is the Db diagram.

The diagram that my VS project has is EXACTLY the same so I know it is correct. (using EF Power Tools).

LinqPad will not connect to this DB. Please see the video here http://screenr.com/U5pN

It seems to be looking for the Db inside 'C:\Program files...\LINQPad4\'.

Please note: this DB is not the DB as per the "final DB" of this tutorial. This DB is the 'tutorial-to-date DB.'

The final DB also could not be used in LP4 as LP4 did not understand an "EF CF Abstract class model" (public abstract class Person) as demonstrated here...
http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/implementing-inheritance-with-the-entity-framework-in-an-asp-net-mvc-application

I originally wanted to use the "final DB" but because of the issue with abstract class I built my DB from the beginning of the tutorial by following the tutorial step-by-step.

I am providing very detailed information in the hope the issue/s can be reproduced and resolved.

Thanks

Comments

  • What does the connection string look like in your web.config file? Does it have the special path variable |App_Data|? If so - that is probably what is tripping things up. Try converting that to the full physical path to your application. Something like: C:\Temp\Contoso\ContosoUniversity\App_Data\ContosoUniversity1.mdf

    If this fixes it - you can also create a copy of your Web.config called Web.linqpad.config that has that hard-coded path and use it for LINQPad.
Sign In or Register to comment.