修改SQL表中数据的问题
Partial Class upuser
Inherits System.Web.UI.Page
Dim sqlcon As New SqlConnection
Dim myCommand As New SqlCommand
Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim student_id As String = Request.Cookies( "userInf ").Values( "userID ")
Dim con As New SqlConnection( "server=.;database=user;uid=lgw;password=lgw ")
Dim cmd As New SqlCommand( "select * from users where id= ' " & Request.Cookies( "userInf ").Values( "userID ") & " ' ", con)
Dim dr As SqlDataReader
con.Open()
dr = cmd.ExecuteReader
dr.Read()
showid.Text = dr.Item( "id ")
showName.Text = dr.Item( "name ")
showTel.Text = dr.Item( "tel ").ToString
showEmail.Text = dr.Item( "email ").ToString
showIntro.Text = dr.Item( "intro ").ToString
con.Close()
If DateTime.Now.Hour > = 6 And DateTime.Now.Hour < 12 Then
spWelMessage.Text = "早上好,登录ID为( " & student_id & ") "
ElseIf DateTime.Now.Hour > = 12 And DateTime.Now.Hour < 18 Then
spWelMessage.Text = "下午好,登录ID为( " & student_id & ") "
Else
spWelMessage.Text = "晚上好,登录ID为( " & student_id & ") "
End If
End Sub
Protected Sub reset_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Reset.Click
showPWD.Text = " "
textpwd.Text = " "