Datasheet

Figure 8-13
10. Press Next.
11. From the Name Method window, change the name textbox to GetProductsDataSet. Make sure
the radio button at the bottom is set to
DataSet and press Finish. We'll look at the DataReader
later in the chapter.
12. Once the code has been added, you want a way to display it. You can do this by switching to
Design view and dragging a DataGrid onto the page.
13. Switch to Code view and add the following code, after the GetProductsDataSet function:
Sub Page_Load(Sender As Object, E As EventArgs)
DataGrid1.DataSource = GetProductsDataSet()
DataGrid1.DataBind()
End Sub
14. Save the page and run it – you should see Figure 8-14:
269
Reading From Databases
57076_Ch 8 SAN.qxd 01/12/2003 6:43 PM Page 269