To add this database to your project, follow the directions for adding existing databases below.
You can use the Add Existing Item dialog box to browse to an existing SQL Server Compact database file (.sdf) and add it to a project. You need to have an existing project loaded into the integrated development environment (IDE). After you add the database to your project, the Data Source Configuration Wizard automatically opens. You can then select the database objects (only tables in the case of SQL Server Compact) to add to the generated dataset that the wizard creates. After you complete the wizard, the tables are added to the Data Sources window, ready to be dropped onto forms to create data-bound controls.
To add an existing SQL Server Compact database to a project
On the Project menu, click Add Existing Item.
In the Add Existing Item dialog box, browse to the location of the SQL Server Compact database file (.sdf) you want to use in the project, and then click Add.
After you add the database file, the Data Source Configuration Wizard opens to the Choose your Database Objects page, and you can select the tables to use in the application.
| Note |
As an alternative to using the Add Existing Item dialog box, you can drag the .sdf file from File Explorer and drop it into your project in Solution Explorer. |
Expand the Tables node and select the tables you want to use in your application.
Click
Finish. The database is added to the project along with a typed dataset that includes the tables selected in the previous step. Additionally, the dataset appears in the
Data Sources Window.
0 comments:
Post a Comment