Viewing and Modifying an SQL CE Database File

,

After an SQL CE file has been retrieved from isolated storage, it can be opened in an application such as Visual Studio or Microsoft SQL Server Management Studio.

To open an .sdf file in Visual Studio follow these steps:

1. Within Visual Studio, right-click the Data Connections node in the Server Explorer and select Add Connection. The Add Connection dialog is displayed (see Figure 29.7).

Image

FIGURE 29.7 Visual Studio’s Add Connection dialog.

2. Within the Add Connection dialog, set the Data Source to Microsoft SQL Server Compact 3.5.

3. Browse and locate the .sdf file using the Connection Properties section.

4. Select OK.

The Server Explorer pane allows you to explore and modify the database schema (see Figure 29.8) and to view table data by right-clicking a table node and selecting Show Table Data.

Image

FIGURE 29.8 Server Explorer with the Twitter.sdf database connected.

The ability to visually explore your database schema is important during development. The next section looks at how to generate an entity model from a database using a database-first approach, allowing you to not only view the schema, but also to make changes to it.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.172.223