private void btnLoad_Click(object sender, EventArgs e) { dbc.openDbConn(); OleDbDataAdapter dataAdapter = new OleDbDataAdapter("SELECT tblLoan.BannerID, tblStudent.Grade, tblStudent.StudName, "+ "tblStudent.StudSurname, tblBook.Title, tblLoan.CopyID FROM tblStudent INNER JOIN "+ "((tblBook INNER JOIN tblCopy ON tblBook.ISBN = tblCopy.ISBN) INNER JOIN tblLoan ON tblCopy.CopyID = tblLoan.CopyID) "+ "ON tblStudent.BannerID = tblLoan.BannerID WHERE tblStudent.Grade = '" + cmbGrade.Text + "'", dbc.conn); DataSet dataset = new DataSet(); dataAdapter.Fill(dataset, "tblLoan"); DataTable table = dataset.Tables[0]; if (dataset.Tables[0].Rows.Count == 0) { crystalReportViewer1.ReportSource = null; crystalReportViewer1.Refresh(); } else { CrystalReport1 o<pre lang="c#"> bjRpt = new CrystalReport1(); objRpt.SetDataSource(table); crystalReportViewer1.ReportSource = objRpt; crystalReportViewer1.Refresh(); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)