1. Technology

Chapter 20 - Data Presentation Using the DataGrid Control

By

5 of 10

The Server Explorer Code
Region Code

Region Code

~~~~~~~~~~~~~~~~~~~~~~~~~
Private Sub btnLoad_Click( _
  ByVal sender As System.Object, _
  ByVal e As System.EventArgs) _
  Handles btnLoad.Click
  DsInstructors1.Clear()
  OleDbDataAdapter1.Fill(DsInstructors1)
  MsgBox("File Read Bytes/Sec " & _
    PerformanceCounter1.NextValue().ToString("N0"))

End Sub
~~~~~~~~~~~~~~~~~~~~~~~~~

The Data Adapter Configuration Wizard demonstrated in the book makes it easy to create the code you need to read a database, but where is that code? The only code we wrote were the Clear and Fill method calls (as shown in the code above). We briefly looked at the answer back in Chapter 5. It's in the (normally hidden) Region code at the top of the program.

To fully understand what the wizard here does for you, it helps to just take a quick look at the code that is added into the Region. Just click on the plus sign at the left. But be careful not to change anything unless you really understand what you're doing.

  1. About.com
  2. Technology
  3. Visual Basic
  4. Learn VB.NET
  5. Data Presentation Using the DataGrid Control

©2014 About.com. All rights reserved.