private void Load_DataGridView() { string sql = "SELECT * FROM tblNhanvien"; tblNhanvien = FunctionConnect.getdata(sql); dataGridView1.DataSource = tblNhanvien; dataGridView1.Columns[0].HeaderText = "Mã nhân viên"; dataGridView1.Columns[0].Width = 50; dataGridView1.Columns[1].HeaderText = "Tên nhân viên"; dataGridView1.Columns[1].Width = 209; dataGridView1.Columns[2].HeaderText = "Giới tính"; dataGridView1.Columns[2].Width = 40; dataGridView1.Columns[3].HeaderText = "Địa chỉ"; dataGridView1.Columns[3].Width = 210; dataGridView1.Columns[4].HeaderText = "Điện thoại"; dataGridView1.Columns[4].Width = 100; dataGridView1.Columns[5].HeaderText = "Ngày sinh"; dataGridView1.Columns[5].Width = 80; }
private void Load_DataGridView() { //string sql = "Select Mahang, Tenhang, Tenchatlieu, SoLuong, Dongianhap, Dongiaban, Anh, Ghichu " + // "from tblHang Inner Join tblChatlieu on tblHang.Machatlieu = tblChatlieu.Machatlieu"; string sql = "Select * from tblHang"; tblHang = FunctionConnect.getdata(sql); DataGridView.DataSource = tblHang; DataGridView.Columns[0].HeaderText = "Mã Hàng"; DataGridView.Columns[0].Width = 80; DataGridView.Columns[1].HeaderText = "Tên Hàng"; DataGridView.Columns[1].Width = 120; DataGridView.Columns[2].HeaderText = "Mã Chất Liệu"; DataGridView.Columns[2].Width = 100; DataGridView.Columns[3].HeaderText = "Số Lượng"; DataGridView.Columns[3].Width = 80; DataGridView.Columns[4].HeaderText = "Đơn Giá Nhập"; DataGridView.Columns[4].Width = 100; DataGridView.Columns[5].HeaderText = "Đơn Giá Bán"; DataGridView.Columns[6].HeaderText = "Ảnh"; DataGridView.Columns[7].HeaderText = "Ghi Chú"; }
private void frmDMHang_Load(object sender, EventArgs e) { Load_DataGridView(); Disable_Enitity(); string sql2 = "Select Machatlieu From tblChatlieu"; cboMachatlieu.DataSource = FunctionConnect.getdata(sql2); cboMachatlieu.DisplayMember = "Machatlieu"; }
public void Load_DataGridView() { string sql = "SELECT * FROM tblChatlieu"; tbl = FunctionConnect.getdata(sql); dataGridView1.DataSource = tbl; dataGridView1.Columns[0].HeaderText = "Mã chất liệu"; dataGridView1.Columns[1].HeaderText = "Tên chất liệu"; dataGridView1.Columns[0].Width = 200; dataGridView1.Columns[1].Width = 200; }
private void Load_DataGridView() { string sql = "SELECT * FROM tblKhach"; tblKhach = FunctionConnect.getdata(sql); DataGridView.DataSource = tblKhach; DataGridView.Columns[0].HeaderText = "Mã nhân viên"; DataGridView.Columns[0].Width = 50; DataGridView.Columns[1].HeaderText = "Tên nhân viên"; DataGridView.Columns[1].Width = 209; DataGridView.Columns[2].HeaderText = "Địa chỉ"; DataGridView.Columns[2].Width = 210; DataGridView.Columns[3].HeaderText = "Điện thoại"; DataGridView.Columns[3].Width = 100; }