Displaying the Data
I've added lines 56-65. On lines 56 and 65 I just create the html structure for a table. The magic happens on lines 57-64. With the command while(dr.Read()) I set up a while loop. The way this works is that our select statement is executed and each row is stored inside the OleDbDataReader object dr. When we invoke dr.Read(), it causes dr to move on to the next row of data. When it has no more rows of data, the while loop ends and we continue executing code on line 65. On lines 60-62 we then actually get the data out of dr. Using GetValue accesses the data at the specific offset. For instance, GetValue(0) gets the first piece of data in that row. GetValue(1) gets the second, etc. It's important to remember that GetValue starts counting from 0, not 1.
In effect, what we're doing is retrieving the name, comment and commentDate from the database for all rows. When we invoke dr.Read(), we advanced to the first return row. We then spit out the commentDate, the name and the comment. Dr then advances to the next row and we repeat the process until dr has no more rows left.
Go ahead and play with the code some. You've just completed some very basic database operations. Congratulations! Next we make our site actually look a bit better.