Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'在此处放置初始化页的用户代码
If Trim(Session("userid")) = "" Or IsDBNull(Session("userid")) Then
Response.Redirect("loin.aspx")
End If
Try
Dim conn As SqlClient.SqlConnection = New SqlClient.SqlConnection("server=(local);database=lianxi;user id=sa;pwd=")
Dim ad As SqlClient.SqlDataAdapter = New SqlClient.SqlDataAdapter("select * from student1 where stuid='" & Trim(Session("userid")) & "'", conn)
Dim st As Data.DataSet = New Data.DataSet
ad.Fill(st, "user")
Label1.Text = st.Tables("user").Rows(0).Item("stuID")
Label2.Text = st.Tables("user").Rows(0).Item("name")
Label3.Text = st.Tables("user").Rows(0).Item("sex")
Label4.Text = st.Tables("user").Rows(0).Item("birthday")
TextBox1.Text = st.Tables("user").Rows(0).Item("adrr")
TextBox2.Text = st.Tables("user").Rows(0).Item("phon")
Catch exc As Exception
Response.Redirect("loin.aspx")
End Try
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim conn As SqlClient.SqlConnection = New SqlClient.SqlConnection("server=(local);database=lianxi;user id=sa;pwd=")
Dim ad As SqlClient.SqlDataAdapter = New SqlClient.SqlDataAdapter("update student1 set adrr='" & Trim(TextBox1.Text) & "' where stuid='" & Trim(Session("userid")) & "'", conn)
Dim st As Data.DataSet = New Data.DataSet
End Sub
我提取数据显示在页面TextBox1.Text ,并且也在页面的TextBox1.Text 上修改,可就是修改不了,也没有错误提示