Learning Resources
Adding a table to the database
To add a table to a database
-
In the Data Connections section of the Server Explorer window, double-click (or expand) the database to which you want to add a table.
-
Right-click the Tables folder and select Add New Table.
The focus moves to the table definition panel for a new table.
-
Add table columns, and specify the column name and data type of the new column, as well as whether the column allows nulls.
-
Select the primary-key column (or press SHIFT+SELECT to select multiple columns for a multi-column primary key), right-click the selection, and then click Set Primary Key.
-
Optionally, select an int (integer) column to specify as an identity column; and then, in the Column Properties panel for the column, double-click the Identity Specification section for the column and set (Is Identity) to Yes.
-
Press CTRL+S to supply a table name and save the table. If you close the table definition panel without saving the table, you will be prompted to supply a table name, and the table will be automatically saved.
To add data to a table in a database
-
In the Data Connections section of the Server Explorer window, double-click (or expand) the database that you want to work with and then double-click the Tables folder for that database.
-
Right-click the table to which you want to add data and then click Show Table Data.
-
In the data grid that appears, type the data that you want to place in the table, providing values for all of the required fields.
-
When you are finished, select the next new row of the data grid. Visual Web Developer now writes the values for the populated row to the table.