In this section, we will learn how to use the Entity Data Model and the Entity Data Source Control to implement our first program using the Entity Framework. We will use a GridView control to display bound data.
Refer to the solution we created earlier using the Entity Data Model Designer. Now, follow these steps:
1. Drag and drop an Entity Data Source control from the toolbox onto your
Default.aspx
web form.2. Now, click on the Configure Data Source option to specify the data source. Refer to the following figure:
3. Specify the Connection String and DefaultContainerName and then click on Next.
4. Specify the fields you would want to retrieve from the database table and click on Finish when done.
5. Now, drag and drop a GridView control from the toolbox onto the
Default.aspx
web form as seen in the following figure:6. Next, use the Choose Data Source option of the GridView control to associate its data source with the Entity Data...