Using the IDE to Create a Dataset File
The Visual Studio IDE makes it easy to create a dataset file. Right-click on the menu Project | Add New Item. The Add New Item dialog box lists Dataset File as an option. Click on this option, give it an appropriate file name and click OK. The dataset file is created and added as an item in the Solution Explorer window. As you can see in Figure 17-1, the dataset is represented in the IDE as an empty screen.
Figure 17-1. The default Dataset designer surface.
At this point, the IDE is ready to build a new dataset file from scratch. Open the Server Explorer and drill down to the appropriate data source to find the table(s) you need. Drag one or more tables from the Server Explorer window onto the dataset surface. Behind the scenes the IDE generates the appropriate code to represent the table(s) with XML. To see what the XML source looks like without opening the file, right-click anywhere on the designer and select the option View XML Source.
Once finished adding the appropriate tables to the dataset your screen will look similar to the one in Figure 17-2.
Figure 17-2. The Dataset designer surface with two tables.
Clicking on the Save button in the toolbar causes the IDE to save the XML source to the dataset file. The file is ready to be linked to the report.