my Database is MS Sql 2005 asp.net environment vb.net coding. im developing a website for my thesis and i need help to solve my problem.
my update code did not work only a msgbox box pop up but it did not edit the data. what is wrong? pls send me a correct code thanks...[/color]
CODE
Protected Sub cmdEdit_Click1(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdEdit.Click
Dim connString As String = _
ConfigurationManager.ConnectionStrings("connstr").ConnectionString
Dim cnn As New SqlClient.SqlConnection(connString)
Try
cnn.Open()
Catch ex As Exception
MsgBox(ex.ToString)
End Try
Dim sql As String = "update VotingCandidateRegistration set 'forFname','forSurname','ForMI','forParty' where VotingCandidateRegistration=('" & txtforStdntNo.Text & "', '" & txtforFname.Text & "','" & txtforSurname.Text & "','" & txtMI.Text & "','" & txtParty.Text & "')"
Dim cmd As New SqlClient.SqlCommand(sql, cnn)
MsgBox("Record has been edited")
cnn.Close()
End Sub