0

value of life certificate is not updating through this code.
myconn.Open()

        cmd.Connection = myconn


    cmd.CommandText = " UPDATE Pension_Master SET  l_cer='" & l_cer & "',validfrom=convert(datetime,'" & validfrom.Date & "',101)," & _
    "validto=convert(datetime,'" & validto.Date & "',101) WHERE ppo_no  = ' " & TextBox1.Text & "'"
    If (payment_register.Visible = True) Then
        payment_register.TextBox4.Text = Me.RadioButton6.Text
    End If
    cmd.ExecuteNonQuery()
    myconn.Close()
2
Contributors
1
Reply
6
Views
1 Year
Discussion Span
Last Post by Reverend Jim
0

Change it to

Dim cmd As String = " UPDATE Pension_Master SET  l_cer='" & l_cer & "',validfrom=convert(datetime,'" & validfrom.Date & "',101)," & _
"validto=convert(datetime,'" & validto.Date & "',101) WHERE ppo_no  = ' " & TextBox1.Text & "'"
Debug.WriteLine(cmd)

and post the output here. You might also try (before doing the update) selecting the records you want to modify and seeing if any records are actually returned. Perhaps the reason the update isn't doing anything is that no records are being selected.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.