Title: Web Application Overview
1Web Application Overview ASP.NET
- ????????????????????????????204200 Browser-Based
Application Development
2Web Application
- HTML
- Web Architecture
- Web Application
- ASP
- Web Database
- ASP.NET
3(No Transcript)
4(No Transcript)
5(No Transcript)
6World Wide Web
library.sut.ac.th
www.sut.ac.th
My Computer
Name Server
www.thairath.com
7World Wide Web
8World Wide Web
library.sut.ac.th
www.sut.ac.th
My Computer
Name Server
www.thairath.com
9World Wide Web
library.sut.ac.th
www.sut.ac.th
My Computer
Name Server
www.thairath.com
10World Wide Web
Caller
Operator
Receiver
11World Wide Web
????????????
??????????????????
Computer
Name Saver
?????????????????????????
12(No Transcript)
13World Wide Web
www.sut.ac.th
203.158.4.30
Computer
Name Saver
www.sut.ac.th (203.158.4.30)
14(No Transcript)
15World Wide Web
library.sut.ac.th
www.sut.ac.th
My Computer
Name Server
www.thairath.com
16World Wide Web
www.sut.ac.th
17World Wide Web
www.sut.ac.th
18World Wide Web
HTML
www.sut.ac.th
Request
19????????????
- World Wide Web
- HTML (Hypertext Mark-up Language)
- ????????????????????????????????????
20HTML
lt????????gt ?????????? lt/????????gt ltIgt ??????????
lt/Igt
21HTML
lt????????????1gt ?????????? lt/????????????1gt ltH1gt
?????????? lt/H1gt
22Web Server
ltHTMLgt ltBODYgt ltH1gtExamplelt/H1gt ltBgtHello
Boldlt/BgtltBRgt ltBgtHello Italiclt/BgtltBRgt lt/BODYgt lt
/HTMLgt
23??????????????? ASP
ltHTMLgt ltBODYgt ltH1gtExamplelt/H1gt ltIMG
SRC"images/SUTLogo.JPG"gt ltBRgt
ltBgtHello Boldlt/BgtltBRgt ltIgtHello
Italiclt/IgtltBRgt Hello ASP 1 1
2 lt/BODYgt lt/HTMLgt
24??????????????? ASP
www.sut.ac.th
Web Browser
Internet Information Server
25??????????????? ASP
Web Browser
Web Server
App. Engine
Database
26??????????????? ASP
Web Browser
Web Server
App. Engine
Database
27Web Application
- HTML
- Web Architecture
- Web Application
- ASP
- Web Database
- ASP.NET
28Web Architecture
Web Browser
Host
Web Server
29Web Architecture
- Apache Web server
- Apache Tomcat
- Internet Information Server
- Netscape Web Server
30Web Architecture
Web Browser
Host
Web
FTP
Mail
31Web Architecture
Client
Host
Web
Browser
FTP
Mail
32Web Architecture
Web Browser
Host
Web
203.158.1.82 203.158.4.3080 First Page
FTP
Mail
33Web Architecture
Web Browser
Host
203.158.1.82 203.158.4.3080 First Page
Web
80
FTP
21
Mail
25
34Web Architecture
Web Browser
Host
203.158.1.82 index.html default.asp
Web
80
FTP
21
Mail
25
35Web Architecture
Web Browser
Host
203.158.1.82 index.html default.asp
Web
80
FTP
21
Mail
25
36Web Architecture
Web Browser
Host
Web
80
FTP
21
Mail
25
37Proxy Server
38Proxy Server
39Web Application
- HTML
- Web Architecture
- Web Application
- ASP
- Web Database
- ASP.NET
40Form
Web Browser
Web Server
203.158.1.82 203.158.4.3080 First Page
41Form
Web Browser
Web Server
203.158.1.82 index.html default.asp
42Form
Web Browser
Web Server
Request Object
43Form
Web Browser
Web Server
Response Object
44Form
45Form
46Form Elements
- File Field
- Text Area
- Drop Down
- Listbox
- Textbox
- Password
- Radio Button
- Checkbox
47Common Gateway Interface (CGI)
48Common Gateway Interface (CGI)
49Common Gateway Interface (CGI)
50Common Gateway Interface (CGI)
Web Browser
Web Server
Request Object
51Common Gateway Interface (CGI)
Web Browser
Web Server
Response Object
52Common Gateway Interface (CGI)
- printf(ltHTMLgt)
- printf(ltBODYgt)
- printf(Hello CGIltBRgt)
- printf(1 1 d, 11)
- printf(lt/BODYgt)
- printf(lt/HTMLgt)
53Common Gateway Interface (CGI)
54Common Gateway Interface (CGI)
Web Browser
Web Server
Response Object
55Common Gateway Interface (CGI)
- printf(ltHTMLgt)
- printf(ltBODYgt)
- printf(Hello CGIltBRgt)
- printf(1 1 d, 11)
- printf(lt/BODYgt)
- printf(lt/HTMLgt)
56Common Gateway Interface (CGI)
Web Browser
Web Server
ltHTMLgt ltBODYgt Hello CGIltBRgt 112 lt/BODYgt lt/HTML
gt
57Common Gateway Interface (CGI)
58Common Gateway Interface (CGI)
59Common Gateway Interface (CGI)
- sum 1 1
- print ltHTMLgt
- print ltBODYgt
- print Hello PerlltBRgt
- print 1 1 sum
- print lt/BODYgt
- print lt/HTMLgt
60Common Gateway Interface (CGI)
61Web Application
- HTML
- Web Architecture
- Web Application
- ASP
- Web Database
- ASP.NET
62??????????????? ASP
Web Browser
Web Server
App. Engine
63??????????????? ASP
Web Browser
Web Server
App. Engine
64??????????????? ASP
ltHTMLgt ltBODYgt ltH1gtExamplelt/H1gt ltBgtHello
Boldlt/BgtltBRgt ltBgtHello Italiclt/BgtltBRgt lt
Response.Write("Hello ASP")
gt lt/BODYgt lt/HTMLgt
65Common Gateway Interface (CGI)
- sum 1 1
- print ltHTMLgt
- print ltBODYgt
- print Hello PerlltBRgt
- print 1 1 sum
- print lt/BODYgt
- print lt/HTMLgt
66??????????????? ASP
ltHTMLgt ltBODYgt ltH1gtExamplelt/H1gt ltBgtHello
Boldlt/BgtltBRgt ltIgtHello Italiclt/IgtltBRgt lt
Response.Write("Hello ASP")
gt lt/BODYgt lt/HTMLgt
67??????????????? ASP
Web Browser
Web Server
ltHTMLgt ltBODYgt ltH1gtExamplelt/H1gt ltBgtHello
Boldlt/BgtltBRgt ltIgtHello Italiclt/IgtltBRgt lt
Response.Write("Hello ASP")
gt lt/BODYgt lt/HTMLgt
ASP Engine
68??????????????? ASP
Web Browser
Web Server
ltHTMLgt ltBODYgt ltH1gtExamplelt/H1gt ltBgtHello
Boldlt/BgtltBRgt ltIgtHello Italiclt/IgtltBRgt lt
Response.Write("Hello ASP")
gt lt/BODYgt lt/HTMLgt
ASP Engine
69??????????????? ASP
Web Browser
Web Server
ltHTMLgt ltBODYgt ltH1gtExamplelt/H1gt ltBgtHello
Boldlt/BgtltBRgt ltIgtHello Italiclt/IgtltBRgt lt
Response.Write("Hello ASP")
gt lt/BODYgt lt/HTMLgt
ASP Engine
70??????????????? ASP
Web Browser
Web Server
ltHTMLgt ltBODYgt ltH1gtExamplelt/H1gt ltBgtHello
Boldlt/BgtltBRgt ltIgtHello Italiclt/IgtltBRgt lt
Response.Write("Hello ASP")
gt lt/BODYgt lt/HTMLgt
ASP Engine
71??????????????? ASP
Web Browser
Web Server
ltHTMLgt ltBODYgt ltH1gtExamplelt/H1gt ltBgtHello
Boldlt/Bgt ltIgtHello Italiclt/Igt Hello
ASP lt/BODYgt lt/HTMLgt
ASP Engine
72??????????????? ASP
Web Browser
Web Server
ltHTMLgt ltBODYgt ltH1gtExamplelt/H1gt ltBgtHello
Boldlt/BgtltBRgt ltIgtHello Italiclt/IgtltBRgt
Hello ASP lt/BODYgt lt/HTMLgt
ASP Engine
73??????????????? ASP
Web Browser
Web Server
Example Hello Bold Hello Italic Hello ASP
ASP Engine
74??????????????? ASP
ltHTMLgt ltBODYgt ltH1gtExamplelt/H1gt ltBgtHello
Boldlt/BgtltBRgt ltIgtHello Italiclt/IgtltBRgt lt
Response.Write("Hello ASP")
gt lt/BODYgt lt/HTMLgt
75Web Server
ltHTMLgt ltBODYgt ltH1gtExamplelt/H1gt ltBgtHello
Boldlt/BgtltBRgt ltIgtHello Italiclt/IgtltBRgt lt/BODYgt lt
/HTMLgt
76Web Server
77Web Server
ltHTMLgt ltBODYgt ltH1gtExamplelt/H1gt ltBgtHello
Boldlt/BgtltBRgt ltBgtHello Italiclt/BgtltBRgt lt/BODYgt lt
/HTMLgt
78??????????????? ASP
ltHTMLgt ltBODYgt ltH1gtExamplelt/H1gt ltBgtHello
Boldlt/BgtltBRgt ltIgtHello Italiclt/IgtltBRgt lt
Response.Write("Hello ASP ltBRgt")
Response.Write("11" 11)
gt lt/BODYgt lt/HTMLgt
79??????????????? ASP
Web Browser
Web Server
ltHTMLgt ltBODYgt ltH1gtExamplelt/H1gt ltBgtHello
Boldlt/BgtltBRgt ltIgtHello Italiclt/IgtltBRgt lt
Response.Write("Hello ASP ltBRgt")
Response.Write("11" 11)
gt lt/BODYgt lt/HTMLgt
ASP Engine
80??????????????? ASP
Web Browser
Web Server
ltHTMLgt ltBODYgt ltH1gtExamplelt/H1gt ltBgtHello
Boldlt/BgtltBRgt ltIgtHello Italiclt/IgtltBRgt lt
Response.Write("Hello ASP ltBRgt")
Response.Write("11" 11)
gt lt/BODYgt lt/HTMLgt
ASP Engine
81??????????????? ASP
Web Browser
Web Server
ltHTMLgt ltBODYgt ltH1gtExamplelt/H1gt ltBgtHello
Boldlt/BgtltBRgt ltIgtHello Italiclt/IgtltBRgt lt
Response.Write("Hello ASP ltBRgt")
Response.Write("11" 11)
gt lt/BODYgt lt/HTMLgt
ASP Engine
82??????????????? ASP
Web Browser
Web Server
ltHTMLgt ltBODYgt ltH1gtExamplelt/H1gt ltBgtHello
Boldlt/BgtltBRgt ltIgtHello Italiclt/IgtltBRgt lt
Response.Write("Hello ASP ltBRgt")
Response.Write("11" 11)
gt lt/BODYgt lt/HTMLgt
ASP Engine
83??????????????? ASP
Web Browser
Web Server
ltHTMLgt ltBODYgt ltH1gtExamplelt/H1gt ltBgtHello
Boldlt/BgtltBRgt ltIgtHello Italiclt/IgtltBRgt
Hello ASPltBRgt 1 1 2 lt/BODYgt lt/HTMLgt
ASP Engine
84??????????????? ASP
Web Browser
Web Server
ltHTMLgt ltBODYgt ltH1gtExamplelt/H1gt ltBgtHello
Boldlt/BgtltBRgt ltIgtHello Italiclt/IgtltBRgt
Hello ASPltBRgt 1 1 2 lt/BODYgt lt/HTMLgt
ASP Engine
85??????????????? ASP
Web Browser
Web Server
Example Hello Bold Hello Italic Hello ASP 1 1
2
ASP Engine
86??????????????? ASP
ltHTMLgt ltBODYgt ltH1gtExamplelt/H1gt ltBgtHello
Boldlt/BgtltBRgt ltBgtHello Italiclt/BgtltBRgt lt
Response.Write("Hello ASP ltBRgt")
Response.Write("11" 11)
gt lt/BODYgt lt/HTMLgt
87??????????????? ASP
Web Browser
Web Server
Request Object
88??????????????? ASP
Web Browser
Web Server
Response Object
89??????????????? ASP
Web Browser
Web Server
ltHTMLgt ltBODYgt ltH1gtExamplelt/H1gt ltIMG
SRC"images/SUTLogo.JPG"gt ltBRgt ltBgtHello
Boldlt/BgtltBRgt ltIgtHello Italiclt/IgtltBRgt Hello
ASP ltBRgt 112 lt/BODYgt lt/HTMLgt
ltHTMLgt ltBODYgt ltH1gtExamplelt/H1gt ltIMG
SRC"images/SUTLogo.JPG"gt ltBRgt
ltBgtHello Boldlt/BgtltBRgt ltIgtHello
Italiclt/IgtltBRgt lt Response.Write("Hello
ASP ltBRgt") Response.Write("11" 11)
gt lt/BODYgt lt/HTMLgt
90??????????????? ASP
Web Browser
Web Server
ltHTMLgt ltBODYgt ltH1gtExamplelt/H1gt ltIMG
SRC"images/SUTLogo.JPG"gt ltBRgt ltBgtHello
Boldlt/BgtltBRgt ltIgtHello Italiclt/IgtltBRgt Hello
ASP ltBRgt 112 lt/BODYgt lt/HTMLgt
91??????????????? ASP
Web Browser
Web Server
92Form ASP
93Form ASP
94Form ASP
Web Browser
Web Server
Request Object
95Form ASP
96Form ASP
97Form ASP
- lthtmlgt
- ltbodygtltform action"demo_simpleform.asp"
method"post"gtYour name ltinput type"text"
name"fname" size"20"gtltinput type"submit"
value"Submit"gtlt/formgtltdim fnamefnameRequest
.Form("fname")If fnameltgt"" Then
Response.Write("Hello " fname "!ltbr
/gt") Response.Write("How are you
today?")End Ifgt - lt/bodygt
- lt/htmlgt
98Form ASP
99Form ASP
- lthtmlgtltdim carscarsRequest.Form("cars")gtltb
odygtltform action"demo_radiob.asp"
method"post"gtltpgtPlease select your favorite
carlt/pgt
100Form ASP
- ltinput type"radio" name"cars"ltif
cars"Volvo" then Response.Write("checked")gtvalu
e"Volvo"gtVolvolt/inputgtltbr /gtltinput
type"radio" name"cars"ltif cars"Saab" then
Response.Write("checked")gtvalue"Saab"gtSaablt/inp
utgtltbr /gtltinput type"radio" name"cars"ltif
cars"BMW" then Response.Write("checked")gtvalue
"BMW"gtBMWlt/inputgt
101Form ASP
- ltbr /gtltbr /gtltinput type"submit" value"Submit"
/gtlt/formgtltif carsltgt"" then
Response.Write("ltpgtYour favorite car is " cars
"lt/pgt")end ifgtlt/bodygtlt/htmlgt
102??????????????? ASP
Web Browser
Web Server
Request Object
103Form ASP
- lthtmlgt
- ltbodygtltform action"demo_simpleform.asp"
method"post"gtYour name ltinput type"text"
name"fname" size"20"gtltinput type"submit"
value"Submit"gtlt/formgtltdim fnamefnameRequest
.Form("fname")If fnameltgt"" Then
Response.Write("Hello " fname "!ltbr
/gt") Response.Write("How are you
today?")End Ifgt - lt/bodygt
- lt/htmlgt
104??????????????? ASP
Web Browser
Web Server
Request Object
105??????????????? ASP
Web Browser
Web Server
Form actiondemo fnamejohn
- lthtmlgt
- ltbodygtltform action"demo_simpleform.asp"
-
- fnameRequest.Form("fname")
- lt/bodygt
- lt/htmlgt
106??????????????? ASP
Web Browser
Web Server
lthtmlgt ltbodygtltformgt lt/formgtlt dim
fnamefnameRequest.Form("fname")If fnameltgt""
Then Response.Write("Hello " fname
"!ltbr /gt") Response.Write("How are you
today?")End If gt lt/bodygt lt/htmlgt
Response Object
107??????????????? ASP
Web Browser
Web Server
ltHTMLgt ltBODYgt ltFORM gt lt/FORMgt Hello
JohnltBRgt How are you today? lt/BODYgt lt/HTMLgt
lthtmlgt ltbodygtltformgt lt/formgtlt dim
fnamefnameRequest.Form("fname")If fnameltgt""
Then Response.Write("Hello " fname
"!ltbr /gt") Response.Write("How are you
today?")End If gt lt/bodygt lt/htmlgt
108??????????????? ASP
Web Browser
Web Server
ltHTMLgt ltBODYgt ltFORM gt lt/FORMgt Hello
JohnltBRgt How are you today? lt/BODYgt lt/HTMLgt
109??????????????? ASP
Web Browser
Web Server
110??????????????? ASP
Web Browser
Web Server
Request Object
111??????????????? ASP
Web Browser
Web Server
Response Object
112Common Gateway Interface (CGI) C/C
- printf(ltHTMLgt)
- printf(ltBODYgt)
- printf(Hello CGIltBRgt)
- printf(1 1 d, 11)
- printf(lt/BODYgt)
- printf(lt/HTMLgt)
113Common Gateway Interface (CGI) - Perl
- sum 1 1
- print ltHTMLgt
- print ltBODYgt
- print Hello PerlltBRgt
- print 1 1 sum
- print lt/BODYgt
- print lt/HTMLgt
114ASP
- ltHTMLgt
- ltBODYgt
- Hello ASPltBRgt
- lt Response.Write(1 1 11) gt
- lt/BODYgt
- lt/HTMLgt
115PHP
- ltHTMLgt
- ltBODYgt
- Hello ASPltBRgt
- lt? echo 1 1 . 11) ?gt
- lt/BODYgt
- lt/HTMLgt
116Web Application
- HTML
- Web Architecture
- Web Application
- ASP
- Web Database
- ASP.NET
117ASP Database
Web Browser
Web Server
ASP Engine
118ASP Database
Web Browser
Web Server
ASP Engine
Database
119ASP Database
Web Browser
Web Server
ASP Engine
Components
ASP Script
Oracle
ADO
Data Provider
SQL
Access
FoxPro
120ASP Database
Web Browser
Web Server
ASP Engine
Database
121ASP Database
Web Browser
Web Server
ASP Engine
Database
122????????????????????????
Web Browser
Web Server
ASP Engine
Database
123????????????????????????
ltHTMLgt ltBODYgt ltH1gtExamplelt/H1gt ltBgtHello
Boldlt/BgtltBRgt ltBgtHello Italiclt/BgtltBRgt lt
ASP Block ???? book_id ??? title
gt lt/BODYgt lt/HTMLgt
124????????????????????????
lt Set conServer.CreateObject("ADODB.Connection")
con.Open "DriverSQL Server SERVERMYCOM
DATABASElibraryUIDuser01PWDpassword" strSQL
"SELECT FROM book" Set rsBooksServer.CreateO
bject("ADODB.Recordset") Set rsBookscon.Execute(s
trSQL) Do While Not rsBooks.Eof Response.Write
rsBooks.Fields("book_id") " " Response.Write
rsBooks.Fields("title") "ltBRgt" rsBooks.MoveNext
Loop con.Close Set conNothing gt
125????????????????????????
lt Set conServer.CreateObject("ADODB.Connection")
con.Open "DriverSQL Server SERVERMYCOM
DATABASElibraryUIDuser01PWDpassword" strSQL
"SELECT FROM book" Set rsBooksServer.CreateO
bject("ADODB.Recordset") Set rsBookscon.Execute(s
trSQL) Do While Not rsBooks.Eof Response.Write
rsBooks.Fields("book_id") " " Response.Write
rsBooks.Fields("title") "ltBRgt" rsBooks.MoveNext
Loop con.Close Set conNothing gt
126????????????????????????
lt Set conServer.CreateObject("ADODB.Connection")
con.Open "DriverSQL Server SERVERMYCOM
DATABASElibraryUIDuser01PWDpassword" strSQL
"SELECT FROM book" Set rsBooksServer.CreateO
bject("ADODB.Recordset") Set rsBookscon.Execute(s
trSQL) Do While Not rsBooks.Eof Response.Write
rsBooks.Fields("book_id") " " Response.Write
rsBooks.Fields("title") "ltBRgt" rsBooks.MoveNext
Loop con.Close Set conNothing gt
127????????????????????????
lt Set conServer.CreateObject("ADODB.Connection")
con.Open "DriverSQL Server SERVERMYCOM
DATABASElibraryUIDuser01PWDpassword" strSQL
"SELECT FROM book" Set rsBooksServer.CreateO
bject("ADODB.Recordset") Set rsBookscon.Execute(s
trSQL) Do While Not rsBooks.Eof Response.Write
rsBooks.Fields("book_id") " " Response.Write
rsBooks.Fields("title") "ltBRgt" rsBooks.MoveNext
Loop con.Close Set conNothing gt
book_id book_name author publisher price
10001 ??????? ??????? ??????? 250.00
10002 ??????????? ????? ??????? 250.00
10003 ??????????? ????? ??????? 220.00
10004 ???????????? ?????? ??????? 300.00
10008 ?????????????????? ???? ????? 100.00
128????????????????????????
lt Set conServer.CreateObject("ADODB.Connection")
con.Open "DriverSQL Server SERVERMYCOM
DATABASElibraryUIDuser01PWDpassword" strSQL
"SELECT FROM book" Set rsBooksServer.CreateO
bject("ADODB.Recordset") Set rsBookscon.Execute(s
trSQL) Do While Not rsBooks.Eof Response.Write
rsBooks.Fields("book_id") " " Response.Write
rsBooks.Fields("title") "ltBRgt" rsBooks.MoveNext
Loop con.Close Set conNothing gt
book_id book_name author publisher price
10001 ??????? ??????? ??????? 250.00
10002 ??????????? ????? ??????? 250.00
10003 ??????????? ????? ??????? 220.00
10004 ???????????? ?????? ??????? 300.00
10008 ?????????????????? ???? ????? 100.00
10001 ??????? ltBRgt
129????????????????????????
lt Set conServer.CreateObject("ADODB.Connection")
con.Open "DriverSQL Server SERVERMYCOM
DATABASElibraryUIDuser01PWDpassword" strSQL
"SELECT FROM book" Set rsBooksServer.CreateO
bject("ADODB.Recordset") Set rsBookscon.Execute(s
trSQL) Do While Not rsBooks.Eof Response.Write
rsBooks.Fields("book_id") " " Response.Write
rsBooks.Fields("title") "ltBRgt" rsBooks.MoveNext
Loop con.Close Set conNothing gt
book_id book_name author publisher price
10001 ??????? ??????? ??????? 250.00
10002 ??????????? ????? ??????? 250.00
10003 ??????????? ????? ??????? 220.00
10004 ???????????? ?????? ??????? 300.00
10008 ?????????????????? ???? ????? 100.00
10001 ??????? ltBRgt 10002 ??????????? ltBRgt
130????????????????????????
lt Set conServer.CreateObject("ADODB.Connection")
con.Open "DriverSQL Server SERVERMYCOM
DATABASElibraryUIDuser01PWDpassword" strSQL
"SELECT FROM book" Set rsBooksServer.CreateO
bject("ADODB.Recordset") Set rsBookscon.Execute(s
trSQL) Do While Not rsBooks.Eof Response.Write
rsBooks.Fields("book_id") " " Response.Write
rsBooks.Fields("title") "ltBRgt" rsBooks.MoveNext
Loop con.Close Set conNothing gt
book_id book_name author publisher price
10001 ??????? ??????? ??????? 250.00
10002 ??????????? ????? ??????? 250.00
10003 ??????????? ????? ??????? 220.00
10004 ???????????? ?????? ??????? 300.00
10008 ?????????????????? ???? ????? 100.00
10001 ??????? ltBRgt 10002 ??????????? ltBRgt 10003
??????????? ltBRgt
131????????????????????????
lt Set conServer.CreateObject("ADODB.Connection")
con.Open "DriverSQL Server SERVERMYCOM
DATABASElibraryUIDuser01PWDpassword" strSQL
"SELECT FROM book" Set rsBooksServer.CreateO
bject("ADODB.Recordset") Set rsBookscon.Execute(s
trSQL) Do While Not rsBooks.Eof Response.Write
rsBooks.Fields("book_id") " " Response.Write
rsBooks.Fields("title") "ltBRgt" rsBooks.MoveNext
Loop con.Close Set conNothing gt
book_id book_name author publisher price
10001 ??????? ??????? ??????? 250.00
10002 ??????????? ????? ??????? 250.00
10003 ??????????? ????? ??????? 220.00
10004 ???????????? ?????? ??????? 300.00
10008 ?????????????????? ???? ????? 100.00
10001 ??????? ltBRgt 10002 ??????????? ltBRgt 10003
??????????? ltBRgt 10004 ???????????? ltBRgt
132????????????????????????
lt Set conServer.CreateObject("ADODB.Connection")
con.Open "DriverSQL Server SERVERMYCOM
DATABASElibraryUIDuser01PWDpassword" strSQL
"SELECT FROM book" Set rsBooksServer.CreateO
bject("ADODB.Recordset") Set rsBookscon.Execute(s
trSQL) Do While Not rsBooks.Eof Response.Write
rsBooks.Fields("book_id") " " Response.Write
rsBooks.Fields("title") "ltBRgt" rsBooks.MoveNext
Loop con.Close Set conNothing gt
book_id book_name author publisher price
10001 ??????? ??????? ??????? 250.00
10002 ??????????? ????? ??????? 250.00
10003 ??????????? ????? ??????? 220.00
10004 ???????????? ?????? ??????? 300.00
10008 ?????????????????? ???? ????? 100.00
10001 ??????? ltBRgt 10002 ??????????? ltBRgt 10003
??????????? ltBRgt 10004 ???????????? ltBRgt 10005
?????????????????? ltBRgt
133????????????????????????
ltHTMLgt ltBODYgt ltH1gtExamplelt/H1gt ltBgtHello
Boldlt/BgtltBRgt ltBgtHello Italiclt/BgtltBRgt lt
ASP Block ???? book_id ??? title
gt lt/BODYgt lt/HTMLgt
134????????????????????????
lt Set conServer.CreateObject("ADODB.Connection")
con.Open "DriverSQL Server SERVERMYCOM
DATABASElibraryUIDuser01PWDpassword" strSQL
"SELECT FROM book" Set rsBooksServer.CreateO
bject("ADODB.Recordset") Set rsBookscon.Execute(s
trSQL) Do While Not rsBooks.Eof Response.Write
rsBooks.Fields("book_id") " " Response.Write
rsBooks.Fields("title") "ltBRgt" rsBooks.MoveNext
Loop con.Close Set conNothing gt
135????????????????????????
136????????????????????????
ltHTMLgt ltBODYgt ltH1gtExamplelt/H1gt ltBgtHello
Boldlt/BgtltBRgt ltBgtHello Italiclt/BgtltBRgt lt
ASP Block ???? book_id ??? title
gt lt/BODYgt lt/HTMLgt
137????????????????????????
Web Browser
Web Server
ltHTMLgt ltBODYgt ltH1gtExamplelt/H1gt ltBgtHello
Boldlt/BgtltBRgt ltBgtHello Italiclt/BgtltBRgt lt
ASP Block ???? book_id ??? title
gt lt/BODYgt lt/HTMLgt
ASP Engine
Database
138????????????????????????
Web Browser
Web Server
ltHTMLgt ltBODYgt ltH1gtExamplelt/H1gt ltBgtHello
Boldlt/BgtltBRgt ltBgtHello Italiclt/BgtltBRgt lt
ASP Block ???? book_id ??? title
gt lt/BODYgt lt/HTMLgt
ASP Engine
Database
139????????????????????????
Web Browser
Web Server
ltHTMLgt ltBODYgt ltH1gtExamplelt/H1gt ltBgtHello
Boldlt/BgtltBRgt ltBgtHello Italiclt/BgtltBRgt lt
ASP Block ???? book_id ??? title
gt lt/BODYgt lt/HTMLgt
ASP Engine
Database
140????????????????????????
Web Browser
Web Server
ltHTMLgt ltBODYgt ltH1gtExamplelt/H1gt ltBgtHello
Boldlt/BgtltBRgt ltBgtHello Italiclt/BgtltBRgt lt
ASP Block ???? book_id ??? title
gt lt/BODYgt lt/HTMLgt
ASP Engine
Database
141????????????????????????
Web Browser
Web Server
Set conServer.CreateObject("ADODB.Connection") co
n.Open "DriverSQL Server SERVERMYCOM
DATABASElibraryUIDuser01PWDpassword" strSQL
"SELECT FROM book" Set rsBooksServer.CreateOb
ject("ADODB.Recordset") Set rsBookscon.Execute(st
rSQL) Do While Not rsBooks.Eof Response.Write
rsBooks.Fields("book_id") " " Response.Write
rsBooks.Fields("title") "ltBRgt" rsBooks.MoveNext
Loop con.Close Set conNothing
ASP Engine
Database
142????????????????????????
Web Browser
Web Server
Set conServer.CreateObject("ADODB.Connection") co
n.Open "DriverSQL Server SERVERMYCOM
DATABASElibraryUIDuser01PWDpassword" strSQL
"SELECT FROM book" Set rsBooksServer.CreateOb
ject("ADODB.Recordset") Set rsBookscon.Execute(st
rSQL) Do While Not rsBooks.Eof Response.Write
rsBooks.Fields("book_id") " " Response.Write
rsBooks.Fields("title") "ltBRgt" rsBooks.MoveNext
Loop con.Close Set conNothing
ASP Engine
Database
143????????????????????????
Web Browser
Web Server
ltHTMLgt ltBODYgt ltH1gtExamplelt/H1gt ltBgtHello
Boldlt/BgtltBRgt ltBgtHello Italiclt/BgtltBRgt lt
ASP Block ???? book_id ??? title
gt lt/BODYgt lt/HTMLgt
ASP Engine
Database
144????????????????????????
Web Browser
Web Server
ltHTMLgt ltBODYgt ltH1gtExamplelt/H1gt ltBgtHello
Boldlt/BgtltBRgt ltBgtHello Italiclt/BgtltBRgt
10001 ??????? ltBRgt 10002 ??????????? ltBRgt
10003 ??????????? ltBRgt 10004 ????????????
ltBRgt 10005 ?????????????????? ltBRgt
lt/BODYgt lt/HTMLgt
ASP Engine
Database
145????????????????????????
Web Browser
Web Server
ltHTMLgt ltBODYgt ltH1gtExamplelt/H1gt ltBgtHello
Boldlt/BgtltBRgt ltBgtHello Italiclt/BgtltBRgt
10001 ??????? ltBRgt 10002 ??????????? ltBRgt
10003 ??????????? ltBRgt 10004 ????????????
ltBRgt 10005 ?????????????????? ltBRgt
lt/BODYgt lt/HTMLgt
ASP Engine
Database
146????????????????????????
Web Browser
Web Server
Example Hello Bold Hello Italic 10001 ???????
10002 ??????????? 10003 ??????????? 10004
???????????? 10005 ??????????????????
ASP Engine
Database
147????????????????????????
ltHTMLgt ltBODYgt ltH1gtExamplelt/H1gt ltBgtHello
Boldlt/BgtltBRgt ltBgtHello Italiclt/BgtltBRgt lt
ASP Block ???? book_id ??? title
gt lt/BODYgt lt/HTMLgt
148Web Application
- HTML
- Web Architecture
- Web Application
- ASP
- Web Database
- ASP.NET
149.NET Framework
Programming Code
Components
Complied to native code
Operating System
Execute
DLL, EXE, etc.
User
150.NET Framework
Programming Code
Components
Complied to byte code
Java Virtual Machine
Compiled into native code Executes
Java Class/Java Applet
User
151.NET Framework
Programming Code
Programming Code
Complied to byte code
Complied to native code
Class/Applet
exe, dll, etc.
User
User
152.NET Framework
.NET Code
.NET Class library
Complied to assembly
common language runtime (CLR)
Compiled into native code Executes
DLL (in MSIL)
User
153.NET Framework
Programming Code
Programming Code
Complied to assembly
Complied to native code
Java Class/Java Applet
exe, dll, etc.
User
User
154.NET Framework
Programming Code
Programming Code
Programming Code
Complied to byte code
Complied to native code
Complied to assembly
Java Class/Java Applet
exe, dll, etc.
Java Class/Java Applet
User
User
User
155ASP.NET
.NET Code
.NET Class library (ASP.NET)
Complied to assembly
common language runtime (CLR)
Compiled into native code Executes
DLL (in MSIL)
User (Server)
156ASP.NET
.NET Code
.NET Class library (ASP.NET)
Complied to assembly
common language runtime (CLR)
Compiled into native code Executes
DLL (in MSIL)
Web Browser
User (Server)
157Web Form
158Web Application
- HTML
- Web Architecture
- Web Application
- ASP
- Web Database
- ASP.NET
159ADO.NET
lt Set conServer.CreateObject("ADODB.Connection")
con.Open "DriverSQL Server SERVERMYCOM
DATABASElibraryUIDuser01PWDpassword" strSQL
"SELECT FROM book" Set rsBooksServer.CreateO
bject("ADODB.Recordset") Set rsBookscon.Execute(s
trSQL) Do While Not rsBooks.Eof Response.Write
rsBooks.Fields("book_id") " " Response.Write
rsBooks.Fields("title") "ltBRgt" rsBooks.MoveNext
Loop con.Close Set conNothing gt
160ADO.NET
lt Set conServer.CreateObject("ADODB.Connection")
con.Open "DriverSQL Server SERVERMYCOM
DATABASElibraryUIDuser01PWDpassword" strSQL
"SELECT FROM book" Set rsBooksServer.CreateO
bject("ADODB.Recordset") Set rsBookscon.Execute(s
trSQL) Do While Not rsBooks.Eof Response.Write
rsBooks.Fields("book_id") " " Response.Write
rsBooks.Fields("title") "ltBRgt" rsBooks.MoveNext
Loop con.Close Set conNothing gt
161ADO.NET
lt Set conServer.CreateObject("ADODB.Connection")
con.Open "DriverSQL Server SERVERMYCOM
DATABASElibraryUIDuser01PWDpassword" strSQL
"SELECT FROM book" Set rsBooksServer.CreateO
bject("ADODB.Recordset") Set rsBookscon.Execute(s
trSQL) Do While Not rsBooks.Eof Response.Write
rsBooks.Fields("book_id") " " Response.Write
rsBooks.Fields("title") "ltBRgt" rsBooks.MoveNext
Loop con.Close Set conNothing gt
book_id book_name author publisher price
10001 ??????? ??????? ??????? 250.00
10002 ??????????? ????? ??????? 250.00
10003 ??????????? ????? ??????? 220.00
10004 ???????????? ?????? ??????? 300.00
10008 ?????????????????? ???? ????? 100.00
162ADO.NET
lt Set conServer.CreateObject("ADODB.Connection")
con.Open "DriverSQL Server SERVERMYCOM
DATABASElibraryUIDuser01PWDpassword" strSQL
"SELECT FROM book" Set rsBooksServer.CreateO
bject("ADODB.Recordset") Set rsBookscon.Execute(s
trSQL) Do While Not rsBooks.Eof Response.Write
rsBooks.Fields("book_id") " " Response.Write
rsBooks.Fields("title") "ltBRgt" rsBooks.MoveNext
Loop con.Close Set conNothing gt
book_id book_name author publisher price
10001 ??????? ??????? ??????? 250.00
10002 ??????????? ????? ??????? 250.00
10003 ??????????? ????? ??????? 220.00
10004 ???????????? ?????? ??????? 300.00
10008 ?????????????????? ???? ????? 100.00
10001 ??????? ltBRgt
163ADO.NET
lt Set conServer.CreateObject("ADODB.Connection")
con.Open "DriverSQL Server SERVERMYCOM
DATABASElibraryUIDuser01PWDpassword" strSQL
"SELECT FROM book" Set rsBooksServer.CreateO
bject("ADODB.Recordset") Set rsBookscon.Execute(s
trSQL) Do While Not rsBooks.Eof Response.Write
rsBooks.Fields("book_id") " " Response.Write
rsBooks.Fields("title") "ltBRgt" rsBooks.MoveNext
Loop con.Close Set conNothing gt
book_id book_name author publisher price
10001 ??????? ??????? ??????? 250.00
10002 ??????????? ????? ??????? 250.00
10003 ??????????? ????? ??????? 220.00
10004 ???????????? ?????? ??????? 300.00
10008 ?????????????????? ???? ????? 100.00
10001 ??????? ltBRgt 10002 ??????????? ltBRgt
164ADO.NET
lt Set conServer.CreateObject("ADODB.Connection")
con.Open "DriverSQL Server SERVERMYCOM
DATABASElibraryUIDuser01PWDpassword" strSQL
"SELECT FROM book" Set rsBooksServer.CreateO
bject("ADODB.Recordset") Set rsBookscon.Execute(s
trSQL) Do While Not rsBooks.Eof Response.Write
rsBooks.Fields("book_id") " " Response.Write
rsBooks.Fields("title") "ltBRgt" rsBooks.MoveNext
Loop con.Close Set conNothing gt
book_id book_name author publisher price
10001 ??????? ??????? ??????? 250.00
10002 ??????????? ????? ??????? 250.00
10003 ??????????? ????? ??????? 220.00
10004 ???????????? ?????? ??????? 300.00
10008 ?????????????????? ???? ????? 100.00
10001 ??????? ltBRgt 10002 ??????????? ltBRgt 10003
??????????? ltBRgt
165ADO.NET
lt Set conServer.CreateObject("ADODB.Connection")
con.Open "DriverSQL Server SERVERMYCOM
DATABASElibraryUIDuser01PWDpassword" strSQL
"SELECT FROM book" Set rsBooksServer.CreateO
bject("ADODB.Recordset") Set rsBookscon.Execute(s
trSQL) Do While Not rsBooks.Eof Response.Write
rsBooks.Fields("book_id") " " Response.Write
rsBooks.Fields("title") "ltBRgt" rsBooks.MoveNext
Loop con.Close Set conNothing gt
book_id book_name author publisher price
10001 ??????? ??????? ??????? 250.00
10002 ??????????? ????? ??????? 250.00
10003 ??????????? ????? ??????? 220.00
10004 ???????????? ?????? ??????? 300.00
10008 ?????????????????? ???? ????? 100.00
10001 ??????? ltBRgt 10002 ??????????? ltBRgt 10003
??????????? ltBRgt 10004 ???????????? ltBRgt
166ADO.NET
lt Set conServer.CreateObject("ADODB.Connection")
con.Open "DriverSQL Server SERVERMYCOM
DATABASElibraryUIDuser01PWDpassword" strSQL
"SELECT FROM book" Set rsBooksServer.CreateO
bject("ADODB.Recordset") Set rsBookscon.Execute(s
trSQL) Do While Not rsBooks.Eof Response.Write
rsBooks.Fields("book_id") " " Response.Write
rsBooks.Fields("title") "ltBRgt" rsBooks.MoveNext
Loop con.Close Set conNothing gt
book_id book_name author publisher price
10001 ??????? ??????? ??????? 250.00
10002 ??????????? ????? ??????? 250.00
10003 ??????????? ????? ??????? 220.00
10004 ???????????? ?????? ??????? 300.00
10008 ?????????????????? ???? ????? 100.00
10001 ??????? ltBRgt 10002 ??????????? ltBRgt 10003
??????????? ltBRgt 10004 ???????????? ltBRgt 10005
?????????????????? ltBRgt
167ADO.NET
ltHTMLgt ltBODYgt ltH1gtExamplelt/H1gt ltBgtHello
Boldlt/BgtltBRgt ltBgtHello Italiclt/BgtltBRgt lt
ASP Block ???? book_id ??? title
gt lt/BODYgt lt/HTMLgt
168ADO.NET
lt Set conServer.CreateObject("ADODB.Connection")
con.Open "DriverSQL Server SERVERMYCOM
DATABASElibraryUIDuser01PWDpassword" strSQL
"SELECT FROM book" Set rsBooksServer.CreateO
bject("ADODB.Recordset") Set rsBookscon.Execute(s
trSQL) Do While Not rsBooks.Eof Response.Write
rsBooks.Fields("book_id") " " Response.Write
rsBooks.Fields("title") "ltBRgt" rsBooks.MoveNext
Loop con.Close Set conNothing gt
169ADO.NET
170ADO.NET
ltHTMLgt ltBODYgt ltH1gtExamplelt/H1gt ltBgtHello
Boldlt/BgtltBRgt ltBgtHello Italiclt/BgtltBRgt lt
ASP Block ???? book_id ??? title
gt lt/BODYgt lt/HTMLgt
171ADO.NET
Web Browser
Web Server
ltHTMLgt ltBODYgt ltH1gtExamplelt/H1gt ltBgtHello
Boldlt/BgtltBRgt ltBgtHello Italiclt/BgtltBRgt lt
ASP Block ???? book_id ??? title
gt lt/BODYgt lt/HTMLgt
ASP Engine
Database
172ADO.NET
Web Browser
Web Server
ltHTMLgt ltBODYgt ltH1gtExamplelt/H1gt ltBgtHello
Boldlt/BgtltBRgt ltBgtHello Italiclt/BgtltBRgt lt
ASP Block ???? book_id ??? title
gt lt/BODYgt lt/HTMLgt
ASP Engine
Database
173ADO.NET
Web Browser
Web Server
ltHTMLgt ltBODYgt ltH1gtExamplelt/H1gt ltBgtHello
Boldlt/BgtltBRgt ltBgtHello Italiclt/BgtltBRgt lt
ASP Block ???? book_id ??? title
gt lt/BODYgt lt/HTMLgt
ASP Engine
Database
174ADO.NET
Web Browser
Web Server
ltHTMLgt ltBODYgt ltH1gtExamplelt/H1gt ltBgtHello
Boldlt/BgtltBRgt ltBgtHello Italiclt/BgtltBRgt lt
ASP Block ???? book_id ??? title
gt lt/BODYgt lt/HTMLgt
ASP Engine
Database
175ADO.NET
Web Browser
Web Server
Set conServer.CreateObject("ADODB.Connection") co
n.Open "DriverSQL Server SERVERMYCOM
DATABASElibraryUIDuser01PWDpassword" strSQL
"SELECT FROM book" Set rsBooksServer.CreateOb
ject("ADODB.Recordset") Set rsBookscon.Execute(st
rSQL) Do While Not rsBooks.Eof Response.Write
rsBooks.Fields("book_id") " " Response.Write
rsBooks.Fields("title") "ltBRgt" rsBooks.MoveNext
Loop con.Close Set conNothing
ASP Engine
Database
176ADO.NET
Web Browser
Web Server
Set conServer.CreateObject("ADODB.Connection") co
n.Open "DriverSQL Server SERVERMYCOM
DATABASElibraryUIDuser01PWDpassword" strSQL
"SELECT FROM book" Set rsBooksServer.CreateOb
ject("ADODB.Recordset") Set rsBookscon.Execute(st
rSQL) Do While Not rsBooks.Eof Response.Write
rsBooks.Fields("book_id") " " Response.Write
rsBooks.Fields("title") "ltBRgt" rsBooks.MoveNext
Loop con.Close Set conNothing
ASP Engine
Database
177ADO.NET
Web Browser
Web Server
ltHTMLgt ltBODYgt ltH1gtExamplelt/H1gt ltBgtHello
Boldlt/BgtltBRgt ltBgtHello Italiclt/BgtltBRgt lt
ASP Block ???? book_id ??? title
gt lt/BODYgt lt/HTMLgt
ASP Engine
Database
178ADO.NET
Web Browser
Web Server
ltHTMLgt ltBODYgt ltH1gtExamplelt/H1gt ltBgtHello
Boldlt/BgtltBRgt ltBgtHello Italiclt/BgtltBRgt
10001 ??????? ltBRgt 10002 ??????????? ltBRgt
10003 ??????????? ltBRgt 10004 ????????????
ltBRgt 10005 ?????????????????? ltBRgt
lt/BODYgt lt/HTMLgt
ASP Engine
Database
179ADO.NET
Web Browser
Web Server
ltHTMLgt ltBODYgt ltH1gtExamplelt/H1gt ltBgtHello
Boldlt/BgtltBRgt ltBgtHello Italiclt/BgtltBRgt
10001 ??????? ltBRgt 10002 ??????????? ltBRgt
10003 ??????????? ltBRgt 10004 ????????????
ltBRgt 10005 ?????????????????? ltBRgt
lt/BODYgt lt/HTMLgt
ASP Engine
Database
180ADO.NET
Web Browser
Web Server
Example Hello Bold Hello Italic 10001 ???????
10002 ??????????? 10003 ??????????? 10004
???????????? 10005 ??????????????????
ASP Engine
Database
181ADO.NET
ltHTMLgt ltBODYgt ltH1gtExamplelt/H1gt ltBgtHello
Boldlt/BgtltBRgt ltBgtHello Italiclt/BgtltBRgt lt
ASP Block ???? book_id ??? title
gt lt/BODYgt lt/HTMLgt
182ADO.NET
RecordSet
DataSet
183ADO.NET
- Connection
- Command
- DataReader
- DataSet
- DataAdapter
184ADO.NET
SqlDataAdaper SelectCommandUpdateCommandInsertC
ommandDeleteCommand
DataSet
SQL
185ADO.NET
186ADO.NET
- Connection
- Command
- DataReader
- DataSet
- DataAdapter
187ADO.NET
RecordSet
DataSet
188SQLHelper and OleDbHelper
dbEmployee
Determine Database
Connect to the Database
dbEmployee
Execute Command
SELECT FROM employee
Use Data
empid empname address
B4700001 ????? 23/12 ???? 7 ?.??????? ?.??????
B4700002 ??????????? 222 ?.??????? ?.????? ?.??????
B4700003 ????? 111 ?????????????? 1 ?.???????
B4700004 ???? 99 ????????????? ???????????
Close Connection
189SQLHelper and OleDbHelper
Determine Database
dbEmployee
SELECT FROM employee
Execute Command
empid empname address
B4700001 ????? 23/12 ???? 7 ?.??????? ?.??????
B4700002 ??????????? 222 ?.??????? ?.????? ?.??????
B4700003 ????? 111 ?????????????? 1 ?.???????
B4700004 ???? 99 ????????????? ???????????
Use Data
190DataBinding
- WebForm Controls
- TextBox
- Label
- DropDownList
- DataGrid
- DataList
- RadioButtonList
- CheckBoxList
- etc.
191DataBinding
192DataBinding
- string ConnectionString "ProviderMicrosoft.Jet.
OLEDB.4.0Data SourceC\\Inetpub\\wwwroot\\e-Comm
erce\\MyStore.mdb" - string SqlStatement "SELECT FROM car"
- DataSet ds new DataSet()
- ds OleDbHelper.ExecuteDataset(ConnectionString,
CommandType.Text, SqlStatement) - ds.Tables0.TableName Car
193DataBinding
TextBox1.Text ds.Tables"Car".Rows0"make".
ToString()
194DataBinding
Label1.Text ds.Tables"Car".Rows0"make".To
String()
195DataBinding
DropDownList1.DataSource
ds DropDownList1.DataTextField
"make" DropDownList1.DataBind()
196DataBinding
DataGrid1.DataSource ds DataGrid1.DataBi
nd()
197DataBinding
RadioButtonList1.DataSource
ds RadioButtonList1.DataTextField
"make" RadioButtonList1.DataBind()
198?????????????????? 5
199Web Application
- HTML
- Web Architecture
- Web Application
- ASP
- Web Database
- ASP.NET
- ASP.NET 2.0
200ASP.NET 2.0
- Web Form Controls
- SqlDatasource Data Control
- Security
- Application State
- Master Page
- Web Part