tailieunhanh - Wrox’s ASP.NET 2.0 Visual Web Develope 2005 Express Edition Starter Kit phần 4

Các cột đầu tiên, tên MenuItemID, được chọn trong bảng MenuItems và các thuộc tính cho cột này được hiển thị trong phần dưới của cửa sổ này. Đây là khóa chính của bảng, như được chỉ ra bởi các biểu tượng quan trọng trong mạng lưới tên cột ở phía trên cùng của cửa sổ. | Building the PPQ Database Figure 3-7 The Table Designer showing the Menuitems and Orders tables The first column named MenuitemiD is selected in the Menuitems table and the properties for this column are shown in the lower section of this window. This is the primary key of the table as indicated by the key symbol in the column name grid at the top of the window. It is also an identity auto-number column and so the identity Specification property value is Yes. The identity increment and identity Seed properties which you find by expanding the identity Specification entry are set to 1 the default values which means that as a row is added to this table the MenuitemiD will be set automatically to the next available positive number. The Orders table displayed in the right-hand window also shows the data types for each column and indicates that the OrderiD column is in the primary key. In this table there is a column named OrderDate that is specified as of type datetime and two columns Deliverycharge and Totalvalue that will contain money currency values. 79 Chapter 3 These last three columns also have a default value set which is inserted into the row if the user does not provide a value when creating a new row. The OrderDate column selected in Figure 3-7 has the value getdate for the Default Value or Binding property. This means that the SQL Server function named getdate will insert the current date into the column for a new row. The Deliverycharge and TotalValue columns have a default value of zero set. The Query Window If you select Show Table Data from the context menu in the Database Explorer window or select this option from the Data menu when a table is selected in the Database Explorer window VWD opens the Query window and displays the contents of all the rows in that table. When building pages that display data this is a good way to see what a table actually contains see Figure 3-8 . Figure 3-8 Viewing the data in a table from the Database Explorer window In .

TỪ KHÓA LIÊN QUAN