Creating the Calendar Database Table


You can store calendar information in a single database table; this table has a simple layout. As with the other data tables in this book, you ll keep the calendar information in the WebMatrix database that you created in Chapter 9.

Create the Calendar table

  1. In Web Matrix, click the New Connection toolbar button in the Data window to connect to MSDE and the WebMatrix database.

  2. In the Data window, open the node for your data server. Select the Tables node, and click the New Item button on the toolbar in the Data window to display the Create New Table dialog box.

  3. In the Table Name box, type Calendar.

  4. Create the columns listed in the following table:

    Name

    Data Type

    Comments

    CalendarID

    Int

    Check Required, Primary Key, and Auto- Increment.

    CalendarDateTime

    DateTime

    Check Required.

    Appointment

    VarChar or NVarChar

    Check Required.

    Field size 50 characters. Make the field size sufficiently large to accommodate the maximum number of characters you intend to use to describe appointments.

The CalendarDateTime column will hold both the date and the time of your appointments. When you ve finished, the dialog box will look like this:

click to expand

  • Click OK to save the table definition.

  • As you can see, there isn t much to the Calendar table. All the fun will be in creating the pages to enter and view the calendar information. Let s start with the page for entering appointments.




    Microsoft ASP. NET Web Matrix Starter Kit
    Microsoft ASP.NET Web Matrix Starter Kit (Bpg-Other)
    ISBN: 0735618569
    EAN: 2147483647
    Year: 2003
    Pages: 169
    Authors: Mike Pope
    BUY ON AMAZON

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net