This documentation is archived and is not being maintained.

Connection String Property, File Properties Dialog Box (Devices) 

This topic has been updated for Visual Studio 2005 SP1.

As a property of an .xsd file, specifies a run-time connection string for the application running on the device.

The run-time connection string is an optional property used when the automatically generated connection string is not adequate. The generated connection string is taken from the connection string within the .xsd schema file and is considered a design-time connection string. This design-time string enables Visual Studio to connect to the database at design-time and retrieve schema information. When this design-time connection string is not adequate for run time, you can use the run-time Connection String property to specify a custom connection string to be serialized into the generated code.

The following paragraph has been updated for Visual Studio 2005 SP1.

For example, Microsoft SQL Mobile and Microsoft SQL Server 2005 Compact Edition connection strings contain a path to the database. The generated connection string in this case translates into a connection string that assumes the database is in the same folder as the executing binary. If the Microsoft SQL Mobile or SQL Server Compact Edition database actually resides in a different location on the device, you can use the Connection String property on the .xsd file to override the generated connection string with a custom connection string.

When you specify a custom connection string in the Connection String property on the .xsd schema file, the design-time connection string stored within the .xsd schema file is not changed, and the design-time features continue to behave as usual. For more information, see How to: Change the Design-Time Connection String (Devices).

The remaining file properties in this window are not specific to smart device projects. For more information, see File Properties.

To open the Properties Window, select the .xsd file in Solution Explorer, and then click Properties Window on the View menu.

Connection String

Specifies the connection string for connecting to the database on the device at run time.

If the box is blank, the application uses the default connection string stored in the .xsd schema file.

See Also