Je ne comprend pas pourquoi dès que je clique sur mIProfesseur, mon DDL prend la valeur de system.datarow, puis prend la valeur recherché.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
private void mIProfesseur_Click(object sender, System.EventArgs e)
		{
			this.Professeur(true,"Professeur");
			this.JourHeure();
			CLConnexion oCon = new CLConnexion();
			oCon.OuvrirConnexion();
			DataSet MonDataSet = new DataSet();
			string Sql = "select * from prof";
			MonDataSet = oCon.Select(Sql,"PROF");
			CBPersonne.DataSource = MonDataSet.Tables["Prof"];
			CBPersonne.DisplayMember = "ProfNom";
			CBPersonne.ValueMember = "ProfNum";
		}

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
private void CBPersonne_SelectedIndexChanged(object sender, System.EventArgs e)
		{
			string Sql;
			bool Num;
			int Prof;
			Num = this.IsNumeric(this.CBPersonne.SelectedValue.ToString());
			if(Num == false)
				Prof = 1;
			else
				Prof = int.Parse(this.CBPersonne.SelectedValue.ToString());
			if(mIProfesseur.Checked)
			{
				Sql = "select InterroJour,InterroPlage,InterroEleve from interrogation where interroprof = " + Prof + " group by interrojour,interroplage,InterroEleve";
				this.EmploiDuTemps(Sql,"Interrogation");
			}
			else if(mIClasse.Checked)
			{
				Sql = "SELECT InterroJour, InterroPlage, InterroEleve FROM interrogation,eleve,classe_act ";
				Sql = Sql + "WHERE interroeleve = elenum and eledivact = classecod and classenum = " + Prof;
				Sql = Sql + " GROUP BY interrojour, interroplage, InterroEleve";
				this.EmploiDuTemps(Sql,"Classe");
			}
		}