コード例 #1
0
ファイル: TrangChu.cs プロジェクト: Truonghunganh/XuanDanh
        private void button1_Click(object sender, EventArgs e)
        {
            DataDAO dataDAO = new DataDAO();

            dataGridView1.Rows.Clear();
            foreach (var item in dataDAO.Data())
            {
                DataGridViewRow  row1 = new DataGridViewRow();
                DataGridViewCell _cell;

                _cell       = new DataGridViewTextBoxCell();
                _cell.Value = item.Ma_SV;
                row1.Cells.Add(_cell);

                _cell       = new DataGridViewTextBoxCell();
                _cell.Value = item.Ten_SV;
                row1.Cells.Add(_cell);

                _cell       = new DataGridViewTextBoxCell();
                _cell.Value = item.NgaySinh;
                row1.Cells.Add(_cell);

                _cell       = new DataGridViewTextBoxCell();
                _cell.Value = item.QueQuan;
                row1.Cells.Add(_cell);

                _cell       = new DataGridViewCheckBoxCell();
                _cell.Value = item.GioiTinh;
                row1.Cells.Add(_cell);

                _cell       = new DataGridViewTextBoxCell();
                _cell.Value = item.HoKhauTT;
                row1.Cells.Add(_cell);

                _cell       = new DataGridViewTextBoxCell();
                _cell.Value = item.DiemTB;
                row1.Cells.Add(_cell);

                _cell       = new DataGridViewTextBoxCell();
                _cell.Value = item.MaKhoa;
                row1.Cells.Add(_cell);

                _cell       = new DataGridViewTextBoxCell();
                _cell.Value = item.TenKhoa;
                row1.Cells.Add(_cell);

                dataGridView1.Rows.Add(row1);
            }
        }