It's likely that more than 50% of the code in the Library Project will directly involve database access, or manipulation of the data retrieved through ADO.NET. Constantly creating new
DataReader objects, although simple, is pretty hard on the fingers. Since so much of the code is repetitive, the code in this chapter's project will try to centralize some of that basic, boilerplate code.
Load the Chapter 10 (Before) Code project, either through the New Project templates or by accessing the project directly from the installation directory. To see the code in its final form, load Chapter 10 (After) Code instead.
The Library Project code has references to several of the important .NET namespaces, such as
Microsoft.VisualBasic. However, it doesn't yet reference any of the ADO.NET namespaces. (Recall that "referencing" means accessing a .NET DLL in a project and using its types in your code.) Before using them in code, we need to create references to them. This is done through the project properties window, on the References tab. You'll see a list of those assemblies already referenced by the application (see Figure 10-9).
Figure 10-9. References included in the Library Project
To add new references, click the Add button just below the list, and select Reference if prompted for the type of reference ...