Public Sub editof(query As String, zi As Integer, p As String, f As String, l As String, oi As Integer)
Try
con.Open()
Dim cmd As New OracleCommand(query, con)
cmd.Parameters.Add(New OracleParameter(“zone_id”, OracleDbType.Int32)).Value = zi
cmd.Parameters.Add(New OracleParameter(“position”, OracleDbType.Varchar2, 25)).Value = p
cmd.Parameters.Add(New OracleParameter(“fname”, OracleDbType.Varchar2, 25)).Value = f
cmd.Parameters.Add(New OracleParameter(“lname”, OracleDbType.Varchar2, 25)).Value = l
cmd.Parameters.Add(New OracleParameter(“officials_id”, OracleDbType.Int32)).Value = oi
cmd.ExecuteNonQuery()
con.Close()
Catch ex As Exception
con.Close()
MsgBox(ex.Message)
End Try
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles
Button1.Click
con.editof("UPDATE high_officials SET
zone_id=?,position=?,fname=?,lname=?
WHERE officials_id=?", cmb.SelectedValue, txtp.Text, txtf.Text, txtl.Text, oi)
Close()
mainform.Button1.PerformClick()
End Sub