예제 #1
0
        //lấy dữ liệu sách
        public void LoadData()
        {
            try
            {
                qlsach = new DataTable();
                qlsach.Clear();
                DataSet ds = dbQLS.LaySach();
                qlsach = ds.Tables[0];

                // Đưa dữ liệu lên DataGridView
                themmasach.Text = tangmatudong();
                // Thay đổi độ rộng cột
                chonmanxb.DataSource    = qlsach;
                chonmanxb.DisplayMember = "manxb";
                this.themmasach.Enabled = false;
            }

            catch (SqlException)
            {
                MessageBox.Show("Không lấy được nội dung trong table cuonsach. Lỗi rồi!!!");
            }
        }
예제 #2
0
        //lấy dữ liệu sách
        public void LoadData()
        {
            try
            {
                dtquanlysach = new DataTable();
                dtquanlysach.Clear();
                DataSet ds = dbQLS.LaySach();
                dtquanlysach = ds.Tables[0];
                // Đưa dữ liệu lên DataGridView
                dataGridView1.DataSource = dtquanlysach;
            }

            catch (SqlException)
            {
                MessageBox.Show("Không lấy được nội dung trong table NguoiDung. Lỗi rồi!!!");
            }
        }