コード例 #1
0
    private void BindDrop()
    {
        try
        {
            TeacherMsts       mst = new TeacherMsts();
            List <TeacherMst> obj = mst.FullDetails();

            ddlTeacher.DataTextField  = "FirstName";
            ddlTeacher.DataValueField = "TeacherID";
            ddlTeacher.DataSource     = obj;
            ddlTeacher.DataBind();
            ddlTeacher.Items.Insert(0, new ListItem("-Select-", "0"));

            CollegeMsts       mst1 = new CollegeMsts();
            List <CollegeMst> obj1 = mst1.FullDetails();

            ddlCollege.DataTextField  = "CollegeName";
            ddlCollege.DataValueField = "CollegeID";
            ddlCollege.DataSource     = obj1;
            ddlCollege.DataBind();
            ddlCollege.Items.Insert(0, new ListItem("-Select-", "0"));
        }
        catch (Exception ex)
        {
        }
    }
コード例 #2
0
    private void BindGridView()
    {
        CollegeMsts       msts    = new CollegeMsts();
        List <CollegeMst> Collage = msts.FullDetails();

        grdTeacherInfo.DataSource = Collage;
        grdTeacherInfo.DataBind();
    }