Exercise: Displaying a Recordset in a DataGrid

In most of the examples in this chapter, we have used print statements or some other simplistic method to display data. However, Visual Basic has always allowed some type of automatic data binding, or associating a set of records with controls on a form. The controls in Visual Basic .NET (such as the DataGrid) are designed for use with ADO.NET. Fortunately, you can take advantage of the fact that XML is a shared format between the older ADO Recordset and ADO.NET DataSet. In this section, we will perform a simple exercise used to display an ADO Recordset in a DataGrid control.

To begin, you’ll need to have the Membership database created in a database and be able to successfully connect to it as ...

Get Special Edition Using Microsoft® Visual Basic® .NET 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.