datagridview update ou refresh ?
re :salut:
pour situer mon probleme
j'ai un datagridview, qui grace à une requete sous oracle , affiche les données que je souhaite .
Lors d'un ajout d'une valeur dans un autre formulaire , je met à jour cette table mais lorsque je retourne sur le datagridview : aucun changement !
il faut fermer l'applicatiion et la réouvrir , ainsi de suite ... pour voir à chaque fois pour voir que la modification a été prise en compte
j'ai fait
Code:
datagridview.refresh()
mais en vain ! je ne sais pas quoi faire pour que le datagridview se mette à jour à l'instant où la ligne de latable change !
SI VOUS REMPLIR VOUS DATAVIEW TU PEUT UTILISER CETTE PROD STANDARD
Code:
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
| Dim ds As New DataSet
Dim dvo As DataView
Deferenterefrence()
N_devisLabel1.Text = N_devis
Try
If MyConnexion.State = ConnectionState.Closed Then MyConnexion.Open()
Mycommand = New OleDbCommand("select * from Tablemarchandise", MyConnexion)
mydataAdapter.SelectCommand = Mycommand
mydataAdapter.Fill(ds, "Create DataView")
mydataAdapter.Dispose()
Mycommand.Dispose()
MyConnexion.Close()
dvo = New DataView(ds.Tables(0), "N_devis = '" & N_devis & "'", "réf", DataViewRowState.CurrentRows)
dvo.AllowDelete = False
dvo.AllowEdit = True
dvo.AllowNew = False
TableMarchandiseDataGridView.DataSource = dvo
ENSACCESSOIRES()
MISEAJOURTOTALPRIX()
Catch ex As Exception
MsgBox(ex.ToString)
Finally
Mycommand.Dispose()
End Try |