djbenji81100
Messages postés66Date d'inscriptionvendredi 9 septembre 2011StatutMembreDernière intervention 4 juin 2012
-
30 mai 2012 à 09:52
djbenji81100
Messages postés66Date d'inscriptionvendredi 9 septembre 2011StatutMembreDernière intervention 4 juin 2012
-
31 mai 2012 à 12:17
Bonjour,
j'utilise visual studio 2010 pour developper en VB.Net et un SGBD Postgres pour la BD.
je suis actuellement en train de developper une application sur la gestion d'un camping .
Mais voila lorsque je veux mettre a jour deux attribue d'un client ( deja dans la BD ) je fait appel a une procedure stocké que voici
CREATE OR REPLACE FUNCTION insertion_info_pers_deja_existante(in Nom_client text, in Prenom_client text, in Code_postal_client text, in Nombre_pers integer, in Combo_animal text) RETURNS integer AS $$
declare
succes integer;
begin
Update Client
set animal Combo_animal, nb_pers Nombre_pers
WHERE nom = Nom_client
AND prenom = Prenom_client
and code_postal = code_postal_client;
return succes = 1;
end;
$$ LANGUAGE plpgsql
La requete fonctionne parfitement lorsque je la test sur Pgadmin , la mise a jour dans la table ce fait correctement .
Par contre, le hic vien maintenant , pour l'integrer a mon code, j'ai fait comme pour toutes les autres requete que j'ai deja mise dans mon application . c'est a dire comme ceci :
Private Sub Reserver_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Reserver.Click
Dim req_sql As String
Dim rs As New ADODB.Recordset
If C_oui.Checked = True Then
req_sql = ("select insertion_info_pers_deja_existante('" & Nom_client.Text & "', '" & Prenom_client.Text & "', '" & Code_postal_client.Text & "', " & Nb_pers.Value & ", '" & Combo_animal.Text & "')")
Try
cn.Open(chaineconnexion)
rs.Open(req_sql, cn, CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockReadOnly)
rs.Close()
cn.Close()
MsgBox("mise a jour ok")
Catch ex As Exception
MsgBox("une Exception est déclenchée" & vbCrLf & ex.Message)
'gestion_erreur(cn)
Finally
' cn = Nothing
End Try
End If
End Sub
cn c'est ma chaine de connexion.
Le code ne me renvoie aucune erreur, mais il ne m'execute pas ma procedure =/