string query = "SELECT Account_Credit.Transaction_No, Account_Credit.Amount_Credit, Account_Credit.Credit_Date, Account_Credit.Total_Amount_Credit, Account_Debit.Transaction_No, Account_Debit.Amount_Debit, Account_Debit.Debit_Date, Account_Debit.Total_Amount_Debit, Accounts.Account_No FROM Account_Credit INNER JOIN Account_Debit ON Account_Credit.Transaction_No = Account_Debit.Transaction_No INNER JOIN Accounts ON Account_Credit.Account_No = Accounts.Account_No and Accounts.Account_No='" + cboaccount1.Text + "-" + cboaccount2.Text + "'"; da = new SqlDataAdapter(query, cn); DataTable dt = new DataTable(); da.Fill(dt); if (dt.Rows.Count == 0) { MessageBox.Show("The Complete Info of Account No'" + cboaccount1.Text + "-" + cboaccount2.Text + "'does not Exists!!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); cboaccount1.SelectAll(); cboaccount1.Focus(); } else { this.Close(); CrystalReport1 crt = new CrystalReport1(); crt.SetDataSource(dt); Report_Viewer rpt = new Report_Viewer(); rpt.Show(); rpt.crystalReportViewer1.ReportSource = crt; rpt.crystalReportViewer1.Refresh(); dt.Clear(); cn.Close(); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)