ASP.NET Logo Back to WebMatrix Home

 
Build an End-to-End Application
Create 'Users' database table
This section of the guided tour will walk you through creating an end-to-end ASP.NET Web Application. The scenario application we will be building offers order reporting services to registered customers.

In this walkthrough, you will create a new database table called Users in the Orders database. We will then use this database table to store the usernames/passwords for registered customers -- and use the built-in ASP.NET Forms Authentication system to enable users to login.
  1. Connect to the Orders database created in a previous section of the guided tour.

     
  2. Click the Tables node in the Data window tree view and click the New Item button on the Data window toolbar.

     
  3. You will see the Create New Table dialog box appear.

     

    Save Users Table

  4. Type Users in the Table Name box.

     
  5. Click the New button in the Columns area of the dialog box.

     
  6. Type UserID in the Name box in the Column Properties area of the dialog box.

     
  7. Select Int in the Data Type drop-down.

     
  8. Select the Required check box and then select the Primary Key and Auto-increment check boxes.

     
  9. Click New to continue adding columns.

     
  10. Add a second column to the Users table called UserName with the following properties:

     

    . Name: UserName
    . Data Type: VarChar
    . Required: True (checked)
    . Primary Key: False (unchecked)
    . Field Size: 8

     

  11. Add a third column to the Users table called UserPassword with the following properties:

     

    . Name: UserPassword
    . Data Type: VarChar
    . Required: True (checked)
    . Primary Key: False (unchecked)
    . Field Size: 25

     

  12. Click OK to save the Users table to the Orders database. 

     
  13. The Users table appears as a Tables child node in the Data window. 

    Users Table Child Node

Next Step >>