Tuesday, October 16, 2012

How to Creating an Entity Data Model from a Database in Asp.net MVC 4

In this post i have given how to create an Entity Data Model in MVC4 project. Here i will create Entity Data model on "TestKrihsna" database which contains eight tables.
Steps for creating EDM:
1.Right click -->select add -->new item -->select "data" in installed templates frame-->select the Ado.net entity data model.

2.We have two option to create EDM which are 1.using Data Base 2.Empty Model.Here i will select Generate From data base option to create EDM with existing database
3.Here we have to select the which data base  used for application .Then the connection string has generated as per sql server credentials.
4.We can see in the below screen ,it  has check box options to select which tables,views and procedures to include in model.Here i have select all table for my application then click on next button
5.Finally we can see the browser window which has entity data model(model.edmx) in VS

 Why we are using entity data model? .

No comments: