parcourir et arranger datatable
bonjour, grace a une requete sql assez complexe, j'obtiens une datatable de ce style :
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 26 27 28 29 30 31
|
Pa 97 2.0905 % OVE 8 10
Pa 97 2.0905 % LVE 9 24
Pa 97 2.0905 % GOO 12 22
CEL 2 0.0431 % NEW 1 22
DIM 4 0.0862 % PRO 4 5
DIM 4 0.0862 % KEL 4 12
DIM 4 0.0862 % OVE 8 10
ESV 1 0.0215 % LOC 1 3
ESV 1 0.0215 % Pa 1 97
GOO 22 0.4741 % YAH 2 4
GOO 22 0.4741 % Pa 12 97
KEL 12 0.2586 % DIM 4 4
KEL 12 0.2586 % Pa 7 97
KEL 12 0.2586 % OVE 8 10
LOC 3 0.0646 % LVE 1 24
LOC 3 0.0646 % ESV 1 1
LOC 3 0.0646 % Pa 2 97
LVE 24 0.5172 % KEL 4 12
LVE 24 0.5172 % OVE 4 10
LVE 24 0.5172 % Pa 9 97
MIV 3 0.0646 % Pa 3 97
NEW 22 0.4741 % Pa 1 97
NEW 22 0.4741 % CEL 1 2
OVE 10 0.2155 % DIM 8 4
OVE 10 0.2155 % Pa 8 97
OVE 10 0.2155 % PRO 10 5
PRO 5 0.1077 % KEL 4 12
PRO 5 0.1077 % DIM 4 4
PRO 5 0.1077 % OVE 10 10
YAH 4 0.0862 % GOO 2 22 |
j'aimerai la parcourir pour la mettre en forme de maniere a ce que j'obtienne une datatable comme cela :
Code:
1 2 3 4 5 6
| Pa 97 2.0905 % OVE 8 10 LVE 9 24 GOO 12 22
CEL 2 0.0431 % NEW 1 22
DIM 4 0.0862 % PRO 4 5 KEL 4 12 OVE 8 10
ESV 1 0.0215 % LOC 1 3 Pa 1 97
GOO 22 0.4741 % YAH 2 4 Pa 12 97
KEL 12 0.2586 % DIM 4 4 Pa 7 97 OVE 8 10 |
c'est a dire faire un filtre sur la premiere colonne de maniere a ne me renvoyer que des lignes uniques (pour la premiere), puis ajouter a cette ligne soit trois soit 6 colonnes supplémentaires et les remplir correctement suivant les données....
Suis je clair???:roll:
D'avance merci!
PS:
ma datable est de ce style :
Code:
1 2 3 4 5 6 7 8 9
| Dim dtRef As New DataTable()
dtRef.Columns.Add(New DataColumn("Ref", GetType(String)))
dtRef.Columns.Add(New DataColumn("NbRef", GetType(Integer)))
dtRef.Columns.Add(New DataColumn("Poids", GetType(String)))
dtRef.Columns.Add(New DataColumn("ReferentB", GetType(String)))
dtRef.Columns.Add(New DataColumn("NbrReferentB", GetType(Integer)))
dtRef.Columns.Add(New DataColumn("NbrTotalReferentB", GetType(Integer))) |