Lesson 8 - DMuirDesigns.com

Download Report

Transcript Lesson 8 - DMuirDesigns.com

Lesson 8
Working with your database
Connect to your database



Make sure that
you’re connected to
the Movies
database in data
explorer
Click on Tables
Click on
JamesBondSeries
This should be on your
screen
Sorting your database


Click on any of the field names and the
database will automatically sort for you
You can also make any changes to the
database and then click Close
Viewing your database
Follow the steps to view your
database on a webpage
Create a new ASP.NET Page
Filename: Showdata.aspx
Working with Tables

Drag the
JamesBondSeries
Table over onto
your workspace
This is what you see…
Press F5 to Start
Start Web Application
Your first database web
page
Notice in your system tray that you now have
your ASP.NET Web Matrix Server Open
Taking a look at Properties
Double click over the database design
grid
Take a look at Properties




Scroll down and
view some of the
Properties
Change the
BackColor to a
color of your choice
Change the
BorderColor to a
color of your choice
Change the
CellPadding to 1
View selected fields




Scroll down to
Fields and click on
elipsis box …
The Members are
your fields
You can delete any
field you don’t want
to view
Remove Member #
4-8 to see how this
works
View your changes



Before you can view your changes you
need to right click over the Microsoft
ASP.NET Web Matrix Servericon in your
System tray and left click on Stop
Why? You can only have one
application running on that port number
8080 which is the default
Now you can press F5 to view your
changes to the grid
More to notice…


Notice the
DataMember name
which is the name
of your table
Notice the
DataSourceControl
ID name
Viewing properties
Here you can view properties of
the DataBindings
Learning a little SQL
commands




You can drag the Properties window to
the left over your workspace to view
these commands
ConnectionString- Notice the
connection on your localserver to your
Movies Database
SelectCommand-The SQL command
used to select records
UpdateCommand-The SQL command
used to update records