private void frmUserInfo_Load(object sender, EventArgs e) { LoadCombobox(); DataTable dt = new DataTable(); dt = balUser.GetAllUser(); PopulateGrid(dt); }
private void LoadGrid() { dgvUser.Rows.Clear(); dgvUser.DataSource = null; DataTable dt = new DataTable(); dt = balUser.GetAllUser(); for (int i = 0; i < dt.Rows.Count; i++) { dgvUser.Rows.Add(); dgvUser.Rows[i].Cells["colUserID"].Value = dt.Rows[i]["userid"].ToString(); dgvUser.Rows[i].Cells["colUsername"].Value = dt.Rows[i]["UserName"].ToString(); dgvUser.Rows[i].Cells["colRoleID"].Value = dt.Rows[i]["RoleID"].ToString(); } }