Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If TextBox3.Text = "" Or TextBox4.Text = "" Then
Label35.Text = "请确认您的输入!"
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)
comm.Parameters.Add(New SqlParameter("@stu_id", SqlDbType.Int, 4))
comm.Parameters("@stu_id").Value = TextBox3.Text
comm.Parameters.Add(New SqlParameter("@pwd", SqlDbType.Char, 16))
comm.Parameters("@pwd").Value = TextBox4.Text
Dim dr As SqlDataReader
conn.Open()
dr = comm.ExecuteReader
If dr.Read Then
Session("stu_id") = TextBox3.Text
dr.Close()
comm.Cancel()
Dim sql_3 As String = "update stu_base set point=point+1 where stu_id=@stu_id"
comm = New SqlCommand(sql_3, conn)
comm.Parameters.Add(New SqlParameter("@stu_id", SqlDbType.Int, 4))
comm.Parameters("@stu_id").Value = Session("stu_id")
comm.ExecuteNonQuery()
comm.Cancel()
Response.Redirect("detail.aspx?stu_id='" & Session("stu_id") & "'")
Else
Label35.Text = "您还没有注册或账号密码错误"
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox1.Text = ""
TextBox2.Text = ""
End Sub转 载:http://www.qqread.com/vbdotnet/c282801.html
相关图文阅读
频道图文推荐
健 康 咨 询
时 尚 咨 询
相关专题
- .NET移动与嵌入式技术 (5880篇文章)
- .NET开发手册 (5585篇文章)
- VB.NET 入门教程 (22167次浏览)
- VB.NET读写文本文件方法 (579次浏览)
- vb.net入门——MDI 窗体的基础使用 (342次浏览)
- 浅析Visual Basic.NET中的资源使用 (322次浏览)
- vb.net入门——Windows 窗体中的提示对话框 (296次浏览)
- vb.net入门——PictureBox控件的使用 (268次浏览)
- vb.net入门——ToolBar 控件的使用 (267次浏览)
- vb.net入门——DateTimePicker 控件的使用 (260次浏览)
- vb.net入门——Splitter 控件的使用 (254次浏览)
- vb.net入门——Windows窗体中的菜单操作 (243次浏览)



