void RemplirInfoEtudiant(String sSql, SqlParameter paramPersonneID) { //string sql = "Select * From Personnes Where PersonneID =; // string Sql = String.Format("SELECT PersonneID, Nom + ', ' + Prenom + '-' + replace(convert(nvarchar,Isnull(DDN,'')), '1900-01-01', 'N/A') + '-' + Isnull(Telephone1,'N/A') as NomComplet FROM Personnes WHERE Nom LIKE '{0}%' AND Prenom LIKE '{1}%'", sLastName, sFirstName); SqlDataReader dt = donnees.GetDataReaderWithParams(sSql, paramPersonneID); if (dt != null) { if (dt.Read()) { txtetude.Text = dt["NiveauEtude"].ToString(); txtNom.Text = dt["Nom"].ToString(); txtPrenom.Text = dt["Prenom"].ToString(); txttelephone.Text = dt["Telephone1"].ToString(); txtrue.Text = dt["AdresseRue"].ToString(); txtemail.Text = dt["Email"].ToString(); txtnumeromaison.Text = dt["Email"].ToString(); // txtdate.Text = dt["DDN"].ToString(); txtville.Text = dt["Ville"].ToString(); txtRemarque.InnerText = dt["Remarque"].ToString(); // Date est speciale, format est: 00-00-0000 for mois-jour-annee string sDate = dt["DDN"].ToString(); if (sDate != string.Empty) { DateTime dtTemp = Convert.ToDateTime(sDate); txtdate.Text = dtTemp.Month.ToString(); if (dtTemp.Month < 10) { txtdate.Text = "0" + txtdate.Text; } if (dtTemp.Day < 10) { txtdate.Text = txtdate.Text + "-0" + dtTemp.Day.ToString() + "-" + dtTemp.Year.ToString(); } else { txtdate.Text = txtdate.Text + "-" + dtTemp.Day.ToString() + "-" + dtTemp.Year.ToString(); } } // Photo } } }