Udostępnij za pośrednictwem


How to: Change the Design-Time Connection String (Devices)

A design-time connection string is created by default when you create a SQL Server Compact 3.5 data source for your project. Visual Studio uses this string to connect to the database at design-time to retrieve schema information. During the course of project development, you might want to change this string.

Distinguish this string from the run-time connection string. For more information, see Connection String Property, File Properties Dialog Box (Devices).

Note

Your computer might show different names or locations for some of the Visual Studio user interface elements in the following instructions. The Visual Studio edition that you have and the settings that you use determine these elements. For more information, see Visual Studio Settings.

To change the design-time connection string

  1. In Solution Explorer, double-click the .xsd file to open the DataSet Designer.

  2. Right-click the TableAdapter, and then click Properties on the shortcut menu.

  3. Expand the Connection property.

  4. Type a new value for ConnectionString.

    Security noteSecurity Note:

    Including a password in a connection string represents a security risk. For more information, see Securing Databases.

See Also

Tasks

How to: Edit a Connection String

Concepts

Data Access Overview (Managed Device Projects)