ASP.NET Guestbook - Connecting to the Database (Page 4 of 8 )
Please refer to the following
link about adding new data sources to the server explorer. After connecting to the database, drill down to the feedback table node. Drag and drop the feedback table to the postcomments.aspx design view. The IDE will design the SqlDataAdapter and SqlConnection components and place it on the component tray as shown:

Right click the SqlDataAdapter1 and click the Generate Dataset option. Accept the dataset name and click OK.

We are now finished connecting to the guestbook database. It’s time for coding!
Inserting Data
After successfully connecting to the database, we have to fill the dataset with the data posted by the visitors. We do this by using the fill method of SqlDataAdapter inside the Page_Load event handler.
Private Sub Page_Load
(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Line1: SqlDataAdapter1.Fill (DataSet11)
End Sub
Line1: The adapter fills the dataset with the data from the table
Next: Feeding the Database >>
More ASP.NET Code Articles
More By R. Abhiram Vikrant