Program-Generated Data

Chapter 5 explains methods you can use to load program-generated data. Example program ProgramGenerated, shown in Figure 6.1, creates a DataTable object and fills it with data. It then binds the DataTable to a DataGrid control to display the results.

Figure 6.1. Example program ProgramGenerated uses compiled-in data to build a DataTable and bind it to a DataGrid control.

The ProgramGenerated example program uses the code shown in Listing 6.1 to display its data. The form’s Load event handler creates a new DataTable object. It uses the DataTable’s Columns collection to add new columns to hold the rows’ values. It then ...

Get Visual Basic® .NET Database Programming 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.