public Filiere get_filiere(string name) { SqlDataReader rdr = null; SqlConnection con = new SqlConnection(@"Data Source=KH_B\SQLEXPRESS;Initial Catalog=db_stage;Integrated Security=True"); string selectSql = "SELECT * from filieres WHERE name = '" + name + "'"; SqlCommand cmd = new SqlCommand(selectSql, con); try { con.Open(); rdr = cmd.ExecuteReader(); while (rdr.Read()) { filiere = new Filiere((string)rdr["name"], (string)rdr["num_module"], (string)rdr["nom_module"], (string)rdr["nbr_horaire"], (string)rdr["details"], (string)rdr["debouches"], (string)rdr["conditions"], (string)rdr["profile_de_formation"]); } } finally { if (rdr != null) { rdr.Close(); } if (con != null) { con.Close(); } } return(filiere); }
protected void Page_Load(object sender, EventArgs e) { Filiere filiere = (Filiere)Session["Filiere"]; title.Text = filiere.name; info.Text = filiere.details; profil.Text = filiere.profile_de_formation; conditions.Text = filiere.conditions; debouche.Text = filiere.debouches; }