dr223
April 8th, 2009, 10:09 AM
Hallo,
I have the following save function shown below, when called some tables get updated. Before fields are updated specifically to TblOracleNos what I want to do is when the text in TxtOracleNo has been changed and the save function called a MsgBox pops saying "Oracle number has been changed".
Any ideas ... Thanks
Public Sub Save()
Dim conn As SqlConnection = GetDbConnection()
Dim query As String
Dim cmd As New SqlCommand
If TxtNumPats.Text >= "1" Then
Try
query = "UPDATE gprdsql.TblPracDetails SET pay_acc_num ='" & _
TxtAccount.Text & "' where Prac_No='" & _
TxtPracNo.Text & "'"
cmd = New SqlCommand(query, conn)
cmd.ExecuteNonQuery()
query = "UPDATE gprdsql.TblPracDetails SET pay_sort_code ='" & _
TxtSort.Text & "' where Prac_No='" & _
TxtPracNo.Text & "'"
cmd = New SqlCommand(query, conn)
cmd.ExecuteNonQuery()
query = "UPDATE gprdsql.TblPracDetails SET payee_name ='" & _
TxtPayee.Text & "' where Prac_No='" & _
TxtPracNo.Text & "'"
cmd = New SqlCommand(query, conn)
cmd.ExecuteNonQuery()
query = "UPDATE gprdsql.TblOracleNos SET Oracle_no ='" & _
TxtOracleNo.Text & "' where Prac_No='" & _
TxtPracNo.Text & "' and Prac_eid = '" & _
TxtPracEid.Text & "' and Pay_method = '" & _
CmbPayMethod.Text & "'"
cmd = New SqlCommand(query, conn)
cmd.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Information, "GCPM")
End Try
I have the following save function shown below, when called some tables get updated. Before fields are updated specifically to TblOracleNos what I want to do is when the text in TxtOracleNo has been changed and the save function called a MsgBox pops saying "Oracle number has been changed".
Any ideas ... Thanks
Public Sub Save()
Dim conn As SqlConnection = GetDbConnection()
Dim query As String
Dim cmd As New SqlCommand
If TxtNumPats.Text >= "1" Then
Try
query = "UPDATE gprdsql.TblPracDetails SET pay_acc_num ='" & _
TxtAccount.Text & "' where Prac_No='" & _
TxtPracNo.Text & "'"
cmd = New SqlCommand(query, conn)
cmd.ExecuteNonQuery()
query = "UPDATE gprdsql.TblPracDetails SET pay_sort_code ='" & _
TxtSort.Text & "' where Prac_No='" & _
TxtPracNo.Text & "'"
cmd = New SqlCommand(query, conn)
cmd.ExecuteNonQuery()
query = "UPDATE gprdsql.TblPracDetails SET payee_name ='" & _
TxtPayee.Text & "' where Prac_No='" & _
TxtPracNo.Text & "'"
cmd = New SqlCommand(query, conn)
cmd.ExecuteNonQuery()
query = "UPDATE gprdsql.TblOracleNos SET Oracle_no ='" & _
TxtOracleNo.Text & "' where Prac_No='" & _
TxtPracNo.Text & "' and Prac_eid = '" & _
TxtPracEid.Text & "' and Pay_method = '" & _
CmbPayMethod.Text & "'"
cmd = New SqlCommand(query, conn)
cmd.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Information, "GCPM")
End Try