This topic describes how to create a new .edmx file by using the Entity Data Model Wizard. An .edmx file contains the the conceptual model, as well as a storage model and the mappings between them. The procedures in this topic describe how to generate an .edmx file that is based on an existing database and how to generate an empty .edmx file.
Create new project in visual studio
Select ASP.NET Empty Web Application
(We can create Class library or console application)
Here Add new item in this project
Here we need to Add ADO.NET Entity Data Model
Now its open the Entity Data Model Wizard , we need to select option like Generate from database.
To create an empty .edmx file select the option Empty model.
Here we need to create New Connection
Select the option Microsoft SQL Server
Enter the Server name here
Select he Database name from the dropdown list.
Click on the Test Connection button ,it will show the Test Connection success message
Now the new connection created and we can see the entity connection string.
Here we have the options to select Tables,Views,Stored Procedures and Functions from that database.
Now our first .edmx file is generated
In our solution of the project we can see .edmx file which generated automatically
Reference
http://msdn.microsoft.com/en-us/library/cc716703(v=vs.103).aspx
Summary
In this article we learned the basic steps to create the EDM
No comments:
Post a Comment