ASP.NET 4.0 and the Entity Framework 4 - Part 1 - Create a Database using Model-First Development
page 1 of 3
Published: 09 Feb 2010
This is the first in a series of articles that will develop an ASP.NET application that uses the Entity Framework 4. This article will demonstrate how to use Visual Studio 2010 and the Entity Framework 4 to create a database in a step-by-step approach. The database created in this article will then be used in future articles to demonstrate how to add, update, delete, and select records using the Entity Framework.
by Vince Varallo
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 27769/ 38


The upcoming release of Visual Studio 2010 will contain the Entity Framework 4 which is Microsoft's second release of the Entity Framework.  The new and improved EF4 contains a boat load of new features which many developers have suggested after using version 1.  It also comes closer to the features offered in other Object-Relational Mapping tools such as NHibernate.  Object-Relational Mapping tools are used to eliminate much of the tedious code needed to have an application persist and retrieve data from a database.  The developer uses a visual interface to build classes that map to tables, relationships, stored procedures, and other objects in a database.  One of the great new features of EF4 is the ability to create an ADO.NET Entity Data Model and then build the database from the model.  Previously the developer needed to create the database first and then generate the model.  EF4 still supports reverse engineering a database but being able to use Visual Studio to design a database based off of an object model is a big step forward with this tool.

The goal of this article is to show you how to create an ADO.NET Entity Data Model using the Entity Framework 4.  This article uses Visual Studio 2010 Beta 2 so some of the steps may change once the final version is released to production.  Future articles will build upon this application to dive deeper into the EF4 to demonstrate how to query and display data, incorporate stored procedures, customize the classes generated by the EF4, and much more.

View Entire Article

User Comments

Title: Kasparov   
Name: Garry Kasparov
Date: 2012-09-27 3:15:40 PM
This is an excellent article and tutorial to start with. Great Work !!!

I look forward to seeing the next articles.
Title: wer   
Name: werwer
Date: 2012-09-21 7:23:31 AM
Title: Select execute sql is not getting in pop-up menu   
Name: Silver
Date: 2012-01-27 12:06:55 AM
How to execute the OrderDB.edmx.sql file? it can't be found in the pop-up menu once I right click it
Title: Mr   
Name: Vibhor
Date: 2011-12-19 5:56:57 AM
Easy and good
Title: Select execute sql is not getting in pop-up menu   
Name: execute sql
Date: 2011-03-31 1:45:03 AM
It is important to note that the tables weren't added to the database yet. In order to actually create the tables you need to right click in the OrderDB.edmx.sql file and select Execute SQL from the pop-up menu. You'll be prompted to log into the server that contains your database. Once you are logged in the script will execute and the objects will be added to your database.
Title: Mr   
Name: Varun Maggo
Date: 2011-03-16 4:18:07 AM
You Rock Maan!

I need to follow your aricles now :)
Title: Nice tutorial   
Name: PongGod
Date: 2011-01-26 1:08:44 AM
Thanks, this makes a great starting point for developers wanting to dive into Entity Framework.
Title: EF4 to demonstrate   
Name: EF4 to demonstrate
Date: 2010-11-18 5:10:43 AM
EF4 to demonstrate
Title: Great Article   
Date: 2010-09-10 7:42:44 AM
Could you please tell me when do u publish next article on Entity Framework.
This article is superb.
Title: Good work   
Name: NurulH
Date: 2010-05-23 10:20:46 AM
Good work, thanks
Title: Good Start   
Name: bdjm
Date: 2010-04-21 11:02:24 AM
This is a good start, but Microsoft & Pluralsight do a much better job. See the hands on lab at:
Title: Excellent WalkThrough   
Name: Sreedevi
Date: 2010-03-31 6:52:51 AM
This is an excellent article. Got the insight of VS2010.

Title: Eagerly Looking For Next Article   
Name: purna
Date: 2010-03-29 10:01:39 AM
Title: Eagerly Looking For Next Article   
Name: Balu
Date: 2010-03-26 10:17:03 AM
Could you please tell me when do u publish next article on Entity Framework.
This article is superb.
Title: Next Article   
Name: Jon Osmanson
Date: 2010-03-13 6:34:14 PM
When are you going to have the next article, that continues the entity framework 4.0? On insert, update, delete, select? Please be soon!!!
Title: Publish Date   
Name: Vince Varallo
Date: 2010-02-26 8:39:12 AM
I'll be writing a series of articles on this website to develop out a similar pattern described in the book but will be using EF 4 rather than LINQ to SQL. There isn't a date for the second version of the book.
Title: Publish date of "Vince Varallo"'s book   
Name: hasan boby
Date: 2010-02-26 2:55:15 AM
I know "Vince Varallo, "the author of this article is going to include the “Entity Framework 4” in his writing 2nd edition of his great book, titled “ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solution”. I am just curious about when the 2nd edition of the book is coming. I mean the rough idea of publish date. I can’t wait to read it.
Title: Hire Asp.Net Developer   
Date: 2010-02-15 12:41:46 AM
The article is good provides useful information & helpful as well.I like the article very much as it is very informative as it give information about ASP.NET application Entity Framework 4 and in future hope to see more of such articles.
Title: Very Good   
Name: Shashi
Date: 2010-02-11 1:43:38 AM
Please explain more how to use it in real time project
Title: Good   
Name: Henry
Date: 2010-02-10 4:49:48 AM
please explain more how to use this in three tier architecture
Title: Great!!!!!!   
Name: Majid Ismail
Date: 2010-02-10 12:02:29 AM
This is really a great way to build Database from modal. I'll look forward for some more detail articles about Entity FrameWork.

Community Advice: ASP | SQL | XML | Regular Expressions | Windows

©Copyright 1998-2024  |  Page Processed at 2024-07-23 1:55:45 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search