Ejemplo n.º 1
0
    private void BindDrop()
    {
        try
        {
            TeacherMsts       msts     = new TeacherMsts();
            List <TeacherMst> Teachers = msts.FullDetails();

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

            StateMsts       mst = new StateMsts();
            List <StateMst> obj = mst.FullDetails();

            ddlstate.DataTextField  = "State_Name";
            ddlstate.DataValueField = "StateID";
            ddlstate.DataSource     = obj;
            ddlstate.DataBind();
            ddlstate.Items.Insert(0, new ListItem("-Select-", "0"));

            DepMsts       msts2 = new DepMsts();
            List <DepMst> obj1  = msts2.FullDetails();

            ddldepartment.DataTextField  = "Dept_Name";
            ddldepartment.DataValueField = "Dept_ID";
            ddldepartment.DataSource     = obj1;
            ddldepartment.DataBind();
            ddldepartment.Items.Insert(0, new ListItem("-Select-", "0"));
        }
        catch (Exception ex)
        {
        }
    }
    private void BindGridView()
    {
        DepMsts       msts = new DepMsts();
        List <DepMst> obj  = msts.FullDetails();

        grddepInfo.DataSource = obj;
        grddepInfo.DataBind();
    }