Beispiel #1
0
        public void LoadData4()
        {
            try
            {
                dtmuonsach = new DataTable();
                dtmuonsach.Clear();
                DataSet ds = dbms.LayMDG(laymadocgia.Text);

                dtmuonsach = ds.Tables[0];
                // Đưa dữ liệu lên DataGridView
                dataGridView2.DataSource = dtmuonsach;
                //laytentacgia.Text = this.dataGridView3.CurrentRow.Cells[1].Value.ToString();
            }

            catch (SqlException)
            {
                MessageBox.Show("Không lấy được nội dung trong table NguoiDung. Lỗi rồi!!!");
            }
        }
Beispiel #2
0
        public void LoadData3()
        {
            try
            {
                dtmuonsach1 = new DataTable();
                dtmuonsach1.Clear();
                DataSet ds = dbMS.LayMDG(this.textBox1.Text);

                dtmuonsach1 = ds.Tables[0];
                // dtmuonsach1.Columns.RemoveAt(0);
                // Đưa dữ liệu lên DataGridView
                dataGridView1.DataSource = dtmuonsach1;
                hienthitendocgia.Text    = this.dataGridView4.CurrentRow.Cells[2].Value.ToString();
                hienthidiachi.Text       = this.dataGridView4.CurrentRow.Cells[3].Value.ToString();
                hienthisdt.Text          = this.dataGridView4.CurrentRow.Cells[4].Value.ToString();
                //  hienthitienno.Text = this.dataGridView1.CurrentRow.Cells[8].Value.ToString();
            }

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