hudon77
Messages postés127Date d'inscriptionvendredi 21 janvier 2005StatutMembreDernière intervention29 mai 2014
-
7 mars 2005 à 21:56
hudon77
Messages postés127Date d'inscriptionvendredi 21 janvier 2005StatutMembreDernière intervention29 mai 2014
-
8 mars 2005 à 02:02
J'ai un bouton edit dans un datagrid. Quand je met de nouvelle valeur
dans mes champs en mode edition et que je clique sur update il fait mon update
mais avec mes anciennes valeurs.....
Private
Sub dg_UpdateCommand(
ByVal source
As
Object,
ByVal e
As DataGridCommandEventArgs)
Handles dg.UpdateCommand
'recupere les champs
Dim nom
As
String =
CType(e.Item.Cells(0).Controls(0), TextBox).Text
Dim prenom
As
String =
CType(e.Item.Cells(1).Controls(0), TextBox).Text
Dim phone
As
String =
CType(e.Item.Cells(2).Controls(0), TextBox).Text
'recupere la cle primaire
Dim id
As
String = dg.DataKeys(e.Item.ItemIndex)
Dim cmdUpdate
As
New Odbc.OdbcCommand
cmdUpdate.Connection = cn
cmdUpdate.CommandText = "update personnes set nom='" & nom & "', prenom='" & prenom & "', tel_maison='" & phone & "' where id=" & id