1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
Dim conn As New OracleConnection(oradb)
Dim cmd As New OracleCommand
Dim cmd1 As New OracleCommand
Dim dr As OracleDataReader
Dim id_domaine As String
Try
conn.Open()
Try
cmd.Connection = conn
cmd.CommandText = "insert into agences (id_agence,nom_agence,adresse_agence,ville_agence,tel_agence,date_ajout_agence) values(seq_agence.nextval,'" + a_nom.Text + "','" + a_adresse.Text + "','" + a_ville.Text + "','" + a_tel.Text + "',sysdate)"
cmd.ExecuteReader()
Catch ex As Exception
MsgBox("$> ERREUR_GUC : " + ex.StackTrace, MsgBoxStyle.Critical)
End Try
Try
MsgBox(a_domaine.SelectedItem)
cmd1.Connection = conn
cmd1.CommandText = "select id_domaine from agences where nom_domaine='Jardinage'"
dr = cmd1.ExecuteReader()
Do While dr.Read()
id_domaine = Convert.ToString(dr("id_domaine"))
MsgBox(id_domaine)
Loop
Catch ex As Exception
MsgBox("$> ERREUR_GUC : " + ex.StackTrace, MsgBoxStyle.Critical)
End Try
Catch ex As Exception
MsgBox("$> ERREUR_GUC : " + ex.Message, MsgBoxStyle.Critical)
Finally
cmd.Dispose() 'Dispose OracleCommand object
' Close and Dispose OracleConnection object
conn.Close()
conn.Dispose()
End Try |
Partager