bonjour j'aimerai remplire une datatable a partir mon tableau qui comporte 6colonne comment je dois faire
Code vb.net : Sélectionner tout - Visualiser dans une fenêtre à part tbl (i,5)
bonjour j'aimerai remplire une datatable a partir mon tableau qui comporte 6colonne comment je dois faire
Code vb.net : Sélectionner tout - Visualiser dans une fenêtre à part tbl (i,5)
Bonjour tu fais une boucle for de 0 jusque le nombre de ligne -1. Et tu affectes chaque valeur de ton tableau à une colonne de ta data.
Voici le code :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13 For i = 0 To DataGridView.Rows.Count - 1 DataGridView.Rows.Add() DataGridView.Rows(i + 1).Cells(0).Value = tableau(i, 0) DataGridView.Rows(i + 1).Cells(1).Value = tableau(i, 1) DataGridView.Rows(i + 1).Cells(2).Value = tableau(i, 2) DataGridView.Rows(i + 1).Cells(3).Value = tableau(i, 3) DataGridView.Rows(i + 1).Cells(4).Value = tableau(i, 4) DataGridView.Rows(i + 1).Cells(5).Value = tableau(i, 5) DataGridView.Rows(i + 1).Cells(6).Value = tableau(i, 6) Next
Partager