private void showDgvBookType() { DataTable dt = new DataTable(); // สร้างอ็อบเจกต์ของคลาส BookType BookType booktype = new BookType(); dt = booktype.read(); dgvBookType.DataSource = dt; }
private void showCboBookType() { BookType booktype = new BookType(); DataTable dt = new DataTable(); dt = booktype.read(); cboBookTypeID.DataSource = dt; cboBookTypeID.DisplayMember = "BookTypeName"; cboBookTypeID.ValueMember = "BookTypeID"; cboBookTypeID.Text = ""; }