How to: Manage Tables in a Database (Devices)
The following steps assume that you have a SQL Server Compact 3.5 database available in Server Explorer. For more information, see How to: Create a Database (Devices).
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 add a table
On the View menu, click Server Explorer.
In Server Explorer, expand the data connection to which you want to add a table.
Right-click Tables, and then click Create Table.
In the New Table dialog box, type a table name in the Name box.
For the first column, enter values for Column Name, Data Type, Length, Allow Nulls, Unique, and Primary Key. Continue for additional columns.
Click OK.
The new table is displayed in the list of tables for the data connection.
To modify an existing table schema
On the View menu, click Server Explorer.
In Server Explorer, expand the data connection where the table schema to be edited is found.
Right-click the table to be edited, and then click Edit Table Schema.
In the Edit Table <Tablename> dialog box, make the changes, and then click OK.
To remove a table
On the View menu, click Server Explorer.
In Server Explorer, expand the data connection from which you want to drop a table.
Under Tables, right-click the table you want to delete, and then click Drop Table.
In the Delete Objects dialog box, click Remove, and then click OK.
Note
You cannot remove a table until all references to the table are deleted.
See Also
Concepts
Using SQL Server Compact 3.5 Databases (Devices)