Make sure the web form that you just created is selected and is in “Design” view. Select the “Toolbox” on the left and drag a new “GridView”control from the “data section” on the the new web form.
Select the arrow on the right of the GridView control and select “New Datasource” in the dropdown menu by “Choose Datasource... “.
Choose “SQL Database” and click “OK”.
Choose the name of the database you created from the dropdown menu and click “Next”.
Make sure “Yes” is checked in the check box and a connection string name has been filled in and click “Next”.
Accept the defaults and click “Next”.
Click “Test Query” to see if the query is successful and then click “Finished”.
Press F5 to start the debugging session to see if the GridView shows in the browser with the data from your database.
No comments:
Post a Comment