Ejemplo n.º 1
0
    public DropDownList GetStudentsForFasl( int SafID, int FaslID, DropDownList dlist)
    {
        OleDbCommand com = new OleDbCommand("SELECT DISTINCT stu_code FROM student_t WHERE  alsofof_code=@alsofof_code and fasl_code=@fasl_code", MySchool.StudentConnection);

        com.Parameters.AddWithValue("@alsofof_code", SafID);
        com.Parameters.AddWithValue("@fasl_code", FaslID);
        com.Connection.Open();
        OleDbDataReader DR = com.ExecuteReader();
        Codes cd = new Codes();
        ListItem li;
        dlist.Items.Clear();
        dlist.Items.Add(new ListItem("ÇÎÊÑ ÇÓã ÇáÊáãíÐ.........","0"));
        while (DR.Read())
        {
            string s = cd.StudentName(Convert.ToInt32(DR["stu_code"]));
            li = new ListItem(s, DR["stu_code"].ToString());
            dlist.Items.Add(li);
        }
        com.Connection.Close();
        return dlist;
    }