01.
Protected
Sub
Page_Load(
ByVal
sender
As
Object
,
ByVal
e
As
System.EventArgs)
Handles
Me
.Load
02.
Dim
sqlConnectionString
As
String
03.
sqlConnectionString = WebConfigurationManager.ConnectionStrings(
"youareteacher"
).ToString()
04.
Dim
Conn
As
New
SqlConnection(sqlConnectionString)
05.
Conn.Open()
06.
07.
08.
09.
10.
11.
Dim
ID
As
String
12.
13.
14.
15.
ID =
"Sc_1234567890"
16.
Dim
Username = Session(
"Username"
)
17.
Dim
Password = Session(
"Pass"
)
18.
Dim
email = Session(
"Email"
)
19.
Dim
Name_Sc = Session(
"Name_Sc"
)
20.
Dim
Type_Sc = Session(
"Type_Sc"
)
21.
Dim
headmaster = Session(
"headmaster"
)
22.
Dim
headgroup = Session(
"headgroup"
)
23.
Dim
headsection = Session(
"headsection"
)
24.
Dim
connector = Session(
"connector"
)
25.
Dim
street = Session(
"street"
)
26.
Dim
Alley = Session(
"Alley"
)
27.
Dim
district = Session(
"district"
)
28.
Dim
boundary = Session(
"boundary"
)
29.
Dim
province = Session(
"province"
)
30.
Dim
tel_Sc = Session(
"tel_Sc"
)
31.
Dim
tel_connect = Session(
"tel_connect"
)
32.
Dim
fax = Session(
"fax"
)
33.
34.
35.
Dim
sqlAdd
As
String
36.
Dim
comAdd
As
New
SqlCommand
37.
38.
39.
sqlAdd =
"INSERT INTO school(ID_Sc,Username,Password,Name_Sc,ID_Type_Sc,headmaster,headgroup,headsection,connect,Street_Sc,Alley_Sc,District_Sc,Boundary_Sc,Province_Sc,Tel_Sc,Tel_connect,Fax_Sc,Email_Sc)"
40.
sqlAdd &=
"VALUES('"
& ID.ToString &
"',"
41.
sqlAdd &=
"'"
& Username.ToString &
"',"
42.
sqlAdd &=
"'"
& Password.ToString &
"',"
43.
44.
sqlAdd &=
"'"
& Name_Sc.ToString &
"',"
45.
sqlAdd &=
"'"
& Type_Sc.ToString &
"',"
46.
sqlAdd &=
"'"
& headmaster.ToString &
"',"
47.
sqlAdd &=
"'"
& headgroup.ToString &
"',"
48.
sqlAdd &=
"'"
& headsection.ToString &
"',"
49.
sqlAdd &=
"'"
& connector.ToString &
"',"
50.
sqlAdd &=
"'"
& street.ToString &
"',"
51.
sqlAdd &=
"'"
& Alley.ToString &
"',"
52.
sqlAdd &=
"'"
& district.ToString &
"',"
53.
sqlAdd &=
"'"
& boundary.ToString &
"',"
54.
sqlAdd &=
"'"
& province.ToString &
"',"
55.
sqlAdd &=
"'"
& tel_Sc.ToString &
"',"
56.
sqlAdd &=
"'"
& tel_connect.ToString &
"',"
57.
sqlAdd &=
"'"
& fax.ToString &
"',"
58.
sqlAdd &=
"'"
& email.ToString &
"')"
59.
60.
comAdd =
New
SqlCommand(sqlAdd, Conn)
61.
62.
Conn.Open()
63.
64.
comAdd.ExecuteNonQuery()
65.
66.
Conn.Close()
67.
68.
69.
MsgBox(
"เพิ่มข้อมูลเรียบร้อยแล้ว"
, MsgBoxStyle.OkOnly)
70.
71.
72.
73.
result.Text =
"ระบบบันทึกข้อมูลของท่านเรียบร้อย เราจะติดต่อกลับไปที่ท่านภายหลัง"
74.
75.
End
Sub
76.
77.
78.
End
Class