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
Abstract
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
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 66679/ 123

Introduction

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: 9/27/2012 3:15:40 PM
Comment:
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: 9/21/2012 7:23:31 AM
Comment:
werwer
Title: Select execute sql is not getting in pop-up menu   
Name: Silver
Date: 1/27/2012 12:06:55 AM
Comment:
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: 12/19/2011 5:56:57 AM
Comment:
Easy and good
Title: Select execute sql is not getting in pop-up menu   
Name: execute sql
Date: 3/31/2011 1:45:03 AM
Comment:
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: 3/16/2011 4:18:07 AM
Comment:
You Rock Maan!

I need to follow your aricles now :)

varun.maggo@hotmail.com
Title: Nice tutorial   
Name: PongGod
Date: 1/26/2011 1:08:44 AM
Comment:
Thanks, this makes a great starting point for developers wanting to dive into Entity Framework.
Title: EF4 to demonstrate   
Name: EF4 to demonstrate
Date: 11/18/2010 5:10:43 AM
Comment:
EF4 to demonstrate
Title: Great Article   
Name: mailvipuls@yahoo.com
Date: 9/10/2010 7:42:44 AM
Comment:
Could you please tell me when do u publish next article on Entity Framework.
This article is superb.
Regards
Vipul
Title: Good work   
Name: NurulH
Date: 5/23/2010 10:20:46 AM
Comment:
Good work, thanks
Title: Good Start   
Name: bdjm
Date: 4/21/2010 11:02:24 AM
Comment:
This is a good start, but Microsoft & Pluralsight do a much better job. See the hands on lab at:

http://code.msdn.microsoft.com/EntityFxHOLPDC09/Release/ProjectReleases.aspx?ReleaseId=3494
Title: Excellent WalkThrough   
Name: Sreedevi
Date: 3/31/2010 6:52:51 AM
Comment:
This is an excellent article. Got the insight of VS2010.

Thanks
Title: Eagerly Looking For Next Article   
Name: purna
Date: 3/29/2010 10:01:39 AM
Comment:
good
Title: Eagerly Looking For Next Article   
Name: Balu
Date: 3/26/2010 10:17:03 AM
Comment:
Hi
Could you please tell me when do u publish next article on Entity Framework.
This article is superb.
Regards
Balu
Title: Next Article   
Name: Jon Osmanson
Date: 3/13/2010 6:34:14 PM
Comment:
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: 2/26/2010 8:39:12 AM
Comment:
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: 2/26/2010 2:55:15 AM
Comment:
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   
Name: cis.neeraj07@gmail.com
Date: 2/15/2010 12:41:46 AM
Comment:
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: 2/11/2010 1:43:38 AM
Comment:
Please explain more how to use it in real time project
Title: Good   
Name: Henry
Date: 2/10/2010 4:49:48 AM
Comment:
please explain more how to use this in three tier architecture
Title: Great!!!!!!   
Name: Majid Ismail
Date: 2/10/2010 12:02:29 AM
Comment:
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-2014 ASPAlliance.com  |  Page Processed at 9/30/2014 11:58:41 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search