01.
Dim
objConn
As
SqlConnection
02.
Dim
objCmd
As
SqlCommand
03.
Dim
strSQL
As
String
04.
05.
06.
Protected
Sub
Page_Load(
ByVal
sender
As
Object
,
ByVal
e
As
System.EventArgs)
07.
If
Session(
"UserAuthentication"
) =
""
Then
08.
Response.Redirect(
"Login1.aspx"
)
09.
End
If
10.
End
Sub
11.
12.
Sub
BindData()
13.
Dim
strConnString
As
String
14.
strConnString =
"Server=localhost\SQLExpress;Database=Myweb;Trusted_Connection=True;"
15.
objConn =
New
SqlConnection(strConnString)
16.
objConn.Open()
17.
18.
Dim
FgPass
As
String
19.
strSQL =
"SELECT Password FROM Username WHERE Username = '"
& txtUsername.Text &
"' "
20.
objCmd =
New
SqlCommand(strSQL, objConn)
21.
FgPass = objCmd.ExecuteScalar()
22.
23.
If
FgPass > 0
Then
24.
lblShow.Text =
""
25.
Else
26.
End
If
27.
28.
29.
End
Sub
30.
Protected
Sub
Button1_Click(
ByVal
sender
As
Object
,
ByVal
e
As
System.EventArgs)
31.
BindData()
32.
End
Sub