Populate theDataSet Object
At this point in the process, you’ve created the proper dataset files and designed the report to use the datasets. If you run the report nothing is printed. This is because the datasets don’t have any data in them. You have to manually populate the datasets prior to opening the report.
Populating the dataset objects is coded differently for each type of data source you are connecting to. It is not within the scope of this book to discuss the best way to connect to a data source.
The code in this section shows the basic ways of populating a dataset for various data sources. Each procedure is called FillDataset() and takes an empty Dataset object. It populates it with the appropriate data. This procedure is called by the code in the next section “Bind the Dataset”.
The purpose of each of these procedures is to give you a quick way to copy and paste this code into your own application and quickly be productive. This should give you a good starting point and serve as a quick reference without having to look up the code in other books.