Summary

In this hour we examined the fundamentals of the DataGrid Web control. The DataGrid Web control was designed to display the results of a SQL SELECT query by using an HTML <table>, where each field in the SELECT query is represented as a column in the <table>, and each row in the query is represented as a row in the <table>.

In order to get a DataGrid to display a query's data, we need to bind the results of the query to a DataGrid. This can be accomplished, first, by using the SELECT Data Method Code Builder to create a function that returns a DataReader containing the results of the SELECT query, and then assigning this DataReader to the DataGrid's DataSource property. Next the DataGrid's DataBind() method is called. This process binds ...

Get SAMS Teach Yourself ASP.NET in 24 Hours 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.