private void frmReportViewer_Load(object sender, EventArgs e) { List <Books> dt = bbll.GetBook(); ReportDataSource rds = new ReportDataSource("dsBooks", dt); this.reportViewer1.LocalReport.DataSources.Clear(); this.reportViewer1.LocalReport.DataSources.Add(rds); this.reportViewer1.LocalReport.ReportEmbeddedResource = "Library.WinUI.rptViewBooks.rdlc"; this.reportViewer1.RefreshReport(); }
private void txtBookCode_KeyUp(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { if (txtBookCode.Text.Trim() != string.Empty) { BooksBLL bll = new BooksBLL(); bk = bll.GetBook().Where(b => b.Code.ToString() == txtBookCode.Text).Single <Books>(); this.txtTitle.Text = bk.Title; this.txtAuthor.Text = bk.Author; this.txtQty.Focus(); } } }