ASP.NET Web Forms Application Using Entity Framework 4.0 Database First

The Contoso University application created by the first of two Web Forms tutorial series at http://asp.net/entity-framework/tutorials/. Continues to be provided alongside version 2 so that it can be used as a starting point for working through the second tutorial series.

 
 
 
 
 
(28)
75,967 times
Add To Favorites
11/5/2012
E-mail Twitter del.icio.us Digg Facebook
Sign in to Ask a Question


  • Should I be using VB Web Express 2010?
    5 Posts | Last Post Tue 4:48 PM
    • Hi
      I am starting with VB Web Express 2012 - only worked with VB6 before (& SQL db)
      
      I don't find  "ASP.NET Web Application template" - only empty Web site, Web Forms site, same with Razor and Dynamic Entities . . .
      I have tried them all and yet I cannot find NavigationMenu even searching through each project?
      
      Also I installed SQLExpress 2005, but when I clicked on the AppData, it returned an error message saying that I needed to make a new connection?
      
      Any ideas?
      Regards
      Tony
    • The tutorial was written for VS 2010 and EF 4.0. VS 2012 has different templates and uses EF 5 by default.
    • Hi Tom
      Eventually (!) I removed 2012 and installed 2010 . . .
      and it all works perfectly!  :)
      Thanks so much
      A question from tutorial 10 - 
      Earlier you created a student statistics grid for the About page that showed the number of students for each enrollment date. The code that does this in HomeController.cs uses LINQ:
      
      var data = from student in db.Students
                 group student by student.EnrollmentDate into dateGroup
                 select new EnrollmentDateGroup()
                 {
                     EnrollmentDate = dateGroup.Key,
                     StudentCount = dateGroup.Count()
                 };
      How does this still work when the Students table is no longer there, having been replaced by the Persons table?
    • and looking at the difference between LINQ and SQL, does LINQ have significant benefits?
      (I ask only in that I am familiar with SQL queries)
      
      pitters
    • On the value of LINQ, see this MSDN page:  http://msdn.microsoft.com/en-us/library/ms178359.aspx#linq
      
      In the earlier tutorial, Code First maps the Student entity to the Student table.  In the later tutorial, the Student entity has been changed so that it derives from the Person entity, and from this Code First knows to look in the Person table for student data.  Your code can remain the same, but EF looks in different database tables for the data depending on how the entity is configured. 
  • Unable to Load Project in Visual Studio 2010 Express
    2 Posts | Last Post March 13, 2012
    • Is it not possible to load this application in VS Express edition, please help, thanks
    • The application does work in Visual Web Developer Express.  Make sure you have service pack 1 installed.
  • Great
    1 Posts | Last Post December 08, 2011
    • Thank you for this code
      
      Twitter @asherjawad