Share via


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

When you add a data source to a project, a connection string is generated in the .xsd file. This string is considered a design-time connection string, appropriate for connecting Visual Studio to the data source at design time. This same connection string serves as the default run-time connection string.

If you need a different connection string when the application runs on a device, you can specify the run-time string by using the following steps. 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 run-time connection string

  1. In Solution Explorer, select the .xsd file.

  2. On the View menu, click Properties Window.

  3. Type a run-time connection string for the Connection String property.

    Security noteSecurity Note:

    Including a password in a connection string represents a security risk. For more information, see Securing Databases (SQL Server Compact 3.5).

See Also

Tasks

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

Concepts

Data Access Overview (Managed Device Projects)