I created a crystal report with two tables..
My SQL query is -:
SELECT ct.custID, c.custName, c.custAdd, ct.custTranDate, ct.custTranType, ct.custPaidAmt, ct.custDueAmt, c.custArea
FROM custTransaction AS ct INNER JOIN custDetails AS c ON ct.custID = c.custID
WHERE ct.custTranDate BETWEEN #2/2/13# AND #3/2/13# and ct.custID='CUST-000002';
when i run this query in access it's works fine.. but when i run this query with OLEDB object, and set dataset to crystal report. crystal report show duplicate records(it's multiple of specific custID in custTransaction. if i entry 3 records of custID='CUST-000002' in custTransaction table,it show 3*3 times same records in crystal report).
My C# code is -:
private void button1_Click(object sender, EventArgs e)
{
OleDbDataAdapter adpt=new OleDbDataAdapter("SELECT ct.custID, c.custName, c.custAdd,ct.custTranDate,ct.custTranType,ct.custPaidAmt,ct.custDueAmt, c.custArea FROM custTransaction ct INNER JOIN custDetails c ON ct.custID = c.custID WHERE ct.custTranDate BETWEEN #"+MF.retOriginalDate(DTP1.Value.Date.ToShortDateString())+"# AND #"+MF.retOriginalDate(DTP2.Value.Date.ToShortDateString())+"# and ct.custID='"+textBox3.Text+"'",conn);
DataSet ds = new DataSet();
adpt.Fill(ds, "custTransaction");
customerLaser CL = new customerLaser();
CL.SetDataSource(ds.Tables["custTransaction"]);
customerLaser CL = new customerLaser();
CL.SetDataSource(DC.dataSet.Tables["custTransaction"]);
CL.SetDatabaseLogon("Admin", "");
CL.Refresh();
report_show RS = new report_show();
RS.crystalReportViewer1.ReportSource = CL;
RS.crystalReportViewer1.Refresh();
RS.Show();
}
I'm using access database....
how to avoid duplicate record in crystal report???
thanks in advance...