How to: Manage Passwords for a Database (Devices)
You can set a password when you create a SQL Server Compact 3.5 database, and you can change the password in an existing database.
Security Note: |
---|
Including a password in a connection string represents a security risk. For more information, see Securing Databases. |
The following sample steps assume that you have a Pocket PC Windows Forms application open.
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 set a password when creating a SQL Server Compact 3.5 database
On the Data menu, click Add New Data Source.
On the Choose a Data Source Type page, click Database, and then click Next.
On the Choose Your Data Connection page, click New Connection to open the Add Connection dialog box.
Click Change, click Microsoft SQL Server Compact 3.5, and then click OK.
In the Add Connection dialog box, click My Computer.
Click Create.
In the Create New SQL Server Compact 3.5 Database dialog box, type a fully-qualified path for the new database (for example, c:\MyDatabase.sdf).
In the New Password and Confirm Password boxes, type a password for the new database, and then click OK.
To change a password in an existing SQL Server Compact 3.5 database
On the View menu, click Server Explorer.
In Server Explorer, right-click the data source for which you want to change the password.
On the shortcut menu, click Database Properties.
In the Database Properties dialog box, click Set password.
Type the old and new passwords as prompted, and then click OK.
See Also
Tasks
How to: Create a Database (Devices)
Concepts
Using SQL Server Compact 3.5 Databases (Devices)