Chapter 18 Getting Started with ADO .NET 449
- Click the Next button.
The wizard displays an alert message indicating that a new local database (or local
data file) has been selected that is not in the current project, and you are asked if the
database should be copied to your project folders. (This message appears only the
first time that you make a connection to a local database file. If you are repeating this
exercise, you probably won’t see the message .) In a commercial application that uses
a database, you might want to control how this works a little more carefully. (To learn
more about your options, you would click the Help button or press F1 .)
- Click No to avoid making an extra copy of the database at this time.
You are not commercially distributing this project; it is only a sample program, and an
extra copy is not needed.
The Data Source Configuration Wizard now asks you the following question: “Do you
want to save the connection string to the application configuration file?” Saving the
connection string is the default selection, and in this example, the recommended string
name is Faculty2010ConnectionString. You usually want to save this string within your
application’s default configuration file, because then if the location of your database
changes, you can edit the string in your configuration file (which is listed in Solution
Explorer), as opposed to tracking down the connection string within your program
code and recompiling the application.
- Click Next to save the default connection string.
You are now prompted to select the subset of database objects that you want to use
for this particular project, as shown in the following dialog box: