Displaying Your Data

Everything you've done so far is invisible at runtime. You've set up a DataAdapter object, a Connection object, and a DataSet object, but you can't see any of these things. In order to actually see the data you're working with, you'll need to add controls to the page. ASP.NET makes this simple.

Adding the Grid

Now that you've set up all the data-handling components, it's time to add the DataGrid control to the page and hook it up. Follow these steps to display the data retrieved by the DataAdapter in a grid:

1.
In the Solution Explorer window, select Products.aspx and select View, Designer (or simply double-click) to view the page in the designer.
2.
From the Web Forms tag of the Toolbox window, drag a DataGrid control ...

Get ASP.NET Developer's JumpStart now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.