Connection String Property, File Properties Dialog Box (Devices)

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

The run-time connection string is an optional property used when the automatically generated connection string is not sufficient. The generated connection string is taken from the connection string in 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 sufficient 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.

For example, Microsoft SQL Server Compact 3.5 connection strings contain a path of 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 SQL Server Compact 3.5 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 in 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, click 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


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

Other Resources

User Interface Reference for Devices