Microsoft Visual Basic 2010 Step by Step eBook

(Tina Meador) #1

470 Part IV Database and Web Programming


Tip It is important that you include the ID field because it is the primary key of the Access
database that you are using. The primary key does not need to be displayed on your
form, but it needs to be included in the dataset so that information from the table can be
written back to the original database if you choose to give the user this option. (I discuss
save operations at the end of this chapter .) If you don’t include the primary key, you may
receive an error message when you try to write data back to the original database.

Your wizard page looks as shown in the following screen shot:


  1. Click Finish to close the Data Source Configuration Wizard.


Visual Studio creates a dataset named Faculty2010DataSet to represent the eight
database objects that you selected. Visual Studio also adds an Extensible Markup
Language (XML) schema file named Faculty2010DataSet .xsd to your project and the
Solution Explorer window. You have now established a connection to the Faculty2010
.accdb database that you can use for the remainder of this chapter.


  1. Click the Save All button on the Standard toolbar to save the project. Specify the
    C:\Vb10sbs\Chap19 folder as the location.

  2. Click the Data Source tab to open the Data Sources window, and then expand the
    Faculty node. (If the Data Sources tab is not visible, click the Show Data Sources
    command on the Data menu .)

Free download pdf