I have used title no. as primary key.
When I am executing this code on SqlManagement Studio it displays the correct data but in Crystal report it repeats data multiple time.
This Is My Code,
Cursor = Cursors.WaitCursor;
timer1.Enabled = true;
RptAccSubject rpt = new RptAccSubject();
frmr_AccSub frm = new frmr_AccSub();
//The report you created.
SqlConnection myConnection = default(SqlConnection);
SqlCommand MyCommand = new SqlCommand();
SqlDataAdapter myDA = new SqlDataAdapter();
lib_dbDataSet myDS = new lib_dbDataSet();
//The DataSet you created.
myConnection = new SqlConnection(cs);
MyCommand.Connection = myConnection;
MyCommand.CommandText = "Select B.TittleName,B.ClassNo,B.Author1,B.NameOfPublsher,B.Subject,I.TotalPages,I.VenderSource,I.OrderNo,I.OrderDate,I.InvoiceBillNo,I.InvoiceBillDt,I.PriceInRs,I.PurPrice,I.Remark,A.AccNo From BookTittle B FULL OUTER JOIN Invoice I on B.TittleNo=I.TittleNo JOIN AccessionRegister A on B.TittleNo=A.TittleNo where A.AccNo between @d1 and @d2 and A.SeriesCode = '" + cmbSeriesCode.Text + "' ";
MyCommand.Parameters.Add("@d1", SqlDbType.Int, 30, "AccNo").Value = textFromAccNo.Text;
MyCommand.Parameters.Add("@d2", SqlDbType.Int, 30, "AccNo").Value = textToAccNo.Text;
MyCommand.CommandType = CommandType.Text;
myDA.SelectCommand = MyCommand;
myDA.Fill(myDS, "BookTittle");
myDA.Fill(myDS, "AccessionRegister");
myDA.Fill(myDS, "Invoice");
rpt.SetDataSource(myDS);
frm.crystalReportViewer1.ReportSource = rpt;
frm.Show();