Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim conn As New SqlConnection
Dim cmd As SqlCommand
Dim dp As New SqlDataAdapter
Dim ds As New DataSet
Dim i As Integer
Dim str As String = "UPDATE aspnet_Membership SET aspnet_Membership.Email='" & Email.Text & "' WHERE UserId='" & Session("id") & "'"
conn = New SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ASPNETDB.mdf;Integrated Security=True;User Instance=True")
conn.Open()
cmd = New SqlCommand()
cmd.CommandType = CommandType.Text
cmd.CommandText = str
cmd.Connection = conn
i = cmd.ExecuteNonQuery()
MsgBox(Session("id"))
Session("id") = Session("id")
MsgBox(Session("id") + "after session")
MsgBox(i)
Dim userName As String = User.Identity.Name
Dim usr As MembershipUser = Membership.GetUser(userName)
'Email.Text = usr.Email
Email.Text = usr.Email
End Sub
in this code when i pring value of i variable its value is 1
but there is no cahnge in database .....
what is the error???