Create an Entity framework file
Go to Visual Studio and create
Windows Forms Application and click OK as shown in Fig 1.
Go to
Solution Explorer, select the solution click on the right mouse button, and then click on Add. Click on
New Item as in the following figure Fig:2.
Select Data from
Visual C# ItemS in the installed template. Select
ADO .NET Entity Data Model, type the model name within parenthesis
Model1.edmx, click on Add as shown in Fig:3,
Select
Generate from database option click on next, then again next as in the following figure 4,
Click on
New Connection type the server name select the radio button and use the windows authentication (also we can use SQL Server authentication). Select the database name within parenthesis and check the
Save entity connection settings in App.Config as, click on Finish as in the following figure 5,
Now choose database objects in Entity Data Model Wizard and select Table which we would like to display then click on Finish. Here's figure 6 showing the same,
Design the form as in the following figure 7,
Write the following code,
Now run the application and check it.
Entity framework is an OR mapping tool. The method of Entity framework is