Private Sub Button_Click(ByVal sender As SystemObject ByVal e As SystemEventArgs) Handles ButtonClick
If TextBoxText = Or TextBoxText = Then
LabelText = 請確認您的輸入!
Return
End If
Dim sql As String = select * from pwd where stu_id=@stu_id and pwd=@pwd
Dim comm As SqlCommand = New SqlCommand(sql conn)
commParametersAdd(New SqlParameter(@stu_id SqlDbTypeInt ))
commParameters(@stu_id)Value = TextBoxText
commParametersAdd(New SqlParameter(@pwd SqlDbTypeChar ))
commParameters(@pwd)Value = TextBoxText
Dim dr As SqlDataReader
connOpen()
dr = commExecuteReader
If drRead Then
Session(stu_id) = TextBoxText
drClose()
commCancel()
Dim sql_ As String = update stu_base set point=point+ where stu_id=@stu_id
comm = New SqlCommand(sql_ conn)
commParametersAdd(New SqlParameter(@stu_id SqlDbTypeInt ))
commParameters(@stu_id)Value = Session(stu_id)
commExecuteNonQuery()
commCancel()
ResponseRedirect(detailaspx?stu_id= & Session(stu_id) & )
Else
LabelText = 您還沒有注冊或賬號密碼錯誤
End If
End Sub
Private Sub Button_Click(ByVal sender As SystemObject ByVal e As SystemEventArgs) Handles ButtonClick
TextBoxText =
TextBoxText =
End Sub
From:http://tw.wingwit.com/Article/program/net/201311/13960.html