private void LoadCbo()
        {
            DataTable dt = new DataTable();

            dt = balUser.GetUserType();
            DataRow dr = dt.NewRow();

            dr["RoleID"]   = 0;
            dr["RoleName"] = "-- Please Select --";
            dt.Rows.InsertAt(dr, 0);
            cboRole.DataSource    = dt;
            cboRole.ValueMember   = "RoleID";
            cboRole.DisplayMember = "RoleName";
        }
Example #2
0
        private void LoadComboBox()
        {
            DataTable dt = new DataTable();

            dt = balUser.GetUserType(1);
            DataRow dr = dt.NewRow();

            dr["Name"] = "Please Select";
            dt.Rows.InsertAt(dr, 0);

            cboUserType.DataSource    = dt;
            cboUserType.DisplayMember = "Name";
            cboUserType.ValueMember   = "RoleID";
        }
        private void frmLogin_Load(object sender, EventArgs e)
        {
            DataTable dt = new DataTable();

            dt = balUser.GetUserType();
            if (dt != null)
            {
                DataRow dr = dt.NewRow();
                dr["RoleName"] = "-- Please Select --";
                dt.Rows.InsertAt(dr, 0);
                cboUserType.DataSource    = dt;
                cboUserType.ValueMember   = "RoleID";
                cboUserType.DisplayMember = "RoleName";
            }
        }