la conversion de type "DBNull" en type "String" n'est pas valide
Bonjour,
j'ai des données dans une datagridview je veux faire double click est afficher les données au texte box voici mon code
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
| Try
Dim MyRow As DataGridViewRow
MyRow = Me.datadevis.Rows(e.RowIndex) ''la ligne clickée
My.Forms.DEVIS.TXT_NUMD.Text = MyRow.Cells.Item("DEV_ID").Value
My.Forms.DEVIS.CBX_CLT.Text = MyRow.Cells.Item("DEV_CLIENT").Value
My.Forms.DEVIS.CBX_VILLE.Text = MyRow.Cells.Item("DEV_VILLE").Value
My.Forms.DEVIS.CBX_SUCR.Text = MyRow.Cells.Item("DEV_SUC").Value
My.Forms.DEVIS.CBX_ATTENT.Text = MyRow.Cells.Item("DEV_CONTACT").Value
My.Forms.DEVIS.CBX_SUIV.Text = MyRow.Cells.Item("DEV_SUIVIPAR").Value
My.Forms.DEVIS.CBX_REF.Text = MyRow.Cells.Item("DEV_REFERENCE").Value
My.Forms.DEVIS.CBX_TRANSP.Text = MyRow.Cells.Item("DEV_TRANSPORT").Value
My.Forms.DEVIS.CBX_SAVMAT.Text = MyRow.Cells.Item("DEV_DSAOUSAV").Value
My.Forms.DEVIS.CBX_GARANTIE.Text = MyRow.Cells.Item("DEV_GARANTI").Value
My.Forms.DEVIS.CBX_VALIDIT.Text = MyRow.Cells.Item("DEV_VALIDITI").Value
My.Forms.DEVIS.CBX_URGENT.Text = MyRow.Cells.Item("DEV_URGENT").Value
My.Forms.DEVIS.CBX_CREGL.Text = MyRow.Cells.Item("DEV_CONDT_REGL").Value
My.Forms.DEVIS.TXT_TTC_CHAR.Text = MyRow.Cells.Item("DEV_TTTC_CHAR").Value
My.Forms.DEVIS.TXT_DAT.Text = MyRow.Cells.Item("DEV_DAT_CREA").Value
My.Forms.DEVIS.RichTextBox2.Text = MyRow.Cells.Item("DEV_TEXTE").Value
Catch ex As Exception
MsgBox("Exception :" & ex.Message)
End Try
My.Forms.DEVIS.ShowDialog() |
mais quand j'ai des données nulle il me donne erreur suivant
Citation:
La conversion de type "DBNull" en type "String" n'est pas valide
Merci de m'aider