Public Sub save_edit()
Dim ssql As String
ssql = "UPDATE tbl_philhealth SET msr = @txtmsr,sb = @sb,tmc = @tmc,ps = @ps,es = @es WHERE msr=@msr"
Dim com As New SqlCeCommand
Using con As SqlCeConnection = New SqlCeConnection("Data Source=" & My.Settings.PATSDB)
Try
With com
con.Open()
com.Parameters.Clear()
com.CommandType = CommandType.Text
com.CommandText = ssql
com.Connection = con
com.Parameters.AddWithValue("@msr", txtmsr.Text)
com.Parameters.AddWithValue("@sb", txtsb.Text)
com.Parameters.AddWithValue("@tmc", txttmc.Text)
com.Parameters.AddWithValue("@ps", txtps.Text)
com.Parameters.AddWithValue("@es", txtes.Text)
End With
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.OkOnly, "Error")
Finally
con.Close()
cmdEdit.Text = "Edit"
cmdClose.Text = "Close"
disable()
MsgBox("Successfully Added!", vbInformation, "Success!")
End Try
End Using
End Sub
No errors at all..
and when i edit some of the textbox it MsgBox("Successfully Added!", vbInformation, "Success!")
BUT no update at all when i RE-run it..
This post has been edited by AdamSpeight2008: 02 February 2012 - 10:41 AM

New Topic/Question
Reply




MultiQuote





|