Hello !

Novice en C#, je cherche depuis hier soir à passer ce bout de code sous la forme d'une fonction avec des variables :


Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
 
cbBandPays.Items.Clear();
 
for (int m = 0; m < Program.groupeList.Count; m++)
if (Program.groupeList[m].GRPE_PAYS != null && cbBandPays.FindStringExact(Program.groupeList[m].GRPE_PAYS.ToString()) < 0)
cbBandPays.Items.Add(Program.groupeList[m].GRPE_PAYS);
J'arrive à passer cbBandPays comme un objet ComboBox et Program.groupeList sous la forme d'un objet GROUPE qui est une table de mon EDM

Par contre comment passer le GRPE_PAYS (une propriété/colonne de la table GROUPE) sous une forme variable ????

Merci d'avance !!!!!