
444 Chapter 9 • Using ADO.NET
Create the DataSet and fill it with the SqlDataAdapter object we created
earlier:
dsShippers = New DataSet()
objAdapter.Fill(dsShippers, "Shippers")
Set the DataSource of our data grid to the newly created DataSet, and call
the DataBind method to finish the grid:
DGShippers.DataSource =
dsShippers.Tables("Shippers").DefaultView
DGShippers.DataBind()
End Sub
Call the BindData procedure from the Page_Load event.The finished product
is shown in Figure 9.9.
The WebForm DataGrid can be further enhanced with the Columns collec-
tion that may contain any or all of the objects in Table 9.5.These give us the
power to create some very appealing ...