Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lesson 7 Managing Data Creating a database with Web Matrix.

Similar presentations


Presentation on theme: "Lesson 7 Managing Data Creating a database with Web Matrix."— Presentation transcript:

1 Lesson 7 Managing Data Creating a database with Web Matrix

2 Connecting to a Database
Steps to connect to a Database in Web Matrix 1. Click on Data explorer which is located on the right of your screen. 2. Click on New Connection

3 Connect to Database Your Server name by default is localhost
You will now click on Create a new database

4 Name your database Type Movies as the name of your database
Notice on the data explorer, you’re connected to the Movies database

5 Creating Tables Click on Tables Click on new item

6 Type JamesBondSeries for your Table Name
Naming your Table Type JamesBondSeries for your Table Name

7 Creating Field Names You’re screen should like this one….

8 Quick lesson on DataTypes
Web Matrix allows you to capture Text Numbers Dates

9 Description of Data Types used for Text
Type of data Name Description Text Char Nchar Default=50 characters Nchar stores as Unicode 16bit VarChar NVarChar Default=50 characters NVarChar stores as 16bit Text NText Stores as pages 8KB NText stores as 16bit

10 Description of Data Types used for Numbers
Type of data Data Type Name Description Numbers Int - 2 billion to + 2 billion Small Int -32,768 to +32,767 Tiny Int 0 to 255 Big Int Stores 1 billion times larger than Int

11 Description of Data Types used for Numbers
Type of data Data Type Name Description Numbers Bit 0 or 1 True/False Yes/No Float Real Not whole numbers Decimal Numbers with fractional parts Money Small Money Monetary values

12 Description of Data Types used for Date & Times
Type of data Data Type Name Description Dates & Times DateTime 1/1/ /31/9999 SmallDateTime 1/1/1900-6/6/2079

13 Enter Field names to Table
In the Column properties name, type ID For data type select Int Click the following: Required; Primary key and Auto Increment Click New when finished

14 More field names Select Column 2 Change name to MovieName
Change data type to char Change Field size to 20 Click New when finished Select Column 3 Change name to Actor Change data type to char Change Field size to 20 Click New when finished

15 More field names Select Column 4 Change name to Actress
Change data type to char Change Field size to 20 Click New when finished Select Column 5 Change name to Director Change data type to char Change Field size to 20 Click New when finished

16 More field names Select Column 6 Change name to Release date
Change data type to Date Click New when finished Select Column 7 Change name to Rating Change data type to Int Click New when finished

17 More field names Select Column 8 Change name to MPAA
Change data type to char Click New when finished Select Column 9 Change name to RunTime Change data type to Int Click OK when finished

18 Entering records into your database
Click on Table Double Click on JamesBondSeries You’re ready to add records

19 Entering records Enter the following records: Press tab to move to next field/column More to enter on next slide

20 Finish entering record


Download ppt "Lesson 7 Managing Data Creating a database with Web Matrix."

Similar presentations


Ads by Google