User218949881 posted
i have crytal report with multiple tables. but if i pass one parameter to SqlDataAdapter.Fill(ds,"Sale") it runs if i pass two it didn't show records on display page
string info = ConfigurationManager.ConnectionStrings["KiranTradersContext"].ConnectionString;
SqlConnection mycon = new SqlConnection(info);
mycon.Open();
string sql = "Select c.Name , p.ProductType ,s.SaleID, s.Date ,s.City, s.Mobile, s.TruckNo,s.Packets,s.Weight,s.Rate,s.Total from sale s, Product p , Customer c where s.ProductID=p.ProductID and s.CustomerID=c.CustomerID";
SqlCommand cmd = new SqlCommand(sql, mycon);
Reporting ds = new Reporting();
SqlDataAdapter myda = new SqlDataAdapter(cmd);
myda.Fill(ds, "Sale,Customer,Product");
// if i pass here one table src it runs
//is there any way to dispaly two table here. i have used join query here
ReportDocument myrpt = new ReportDocument();
myrpt.Load(Server.MapPath("~/Reports/Saleone.rpt"));
myrpt.SetDataSource(ds);
CrystalReportViewer1.ReportSource = myrpt;
CrystalReportViewer1.DataBind();