hi friends,
Error CrystalReports.Engine.DataSourceException: The report has no tables
SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
OpenConnection(con);
cmd.Connection= con;
string sql = "SELECT * from empreg";
SqlDataAdapter myDA = new SqlDataAdapter(sql, con);
ReportDocument rpt = new ReportDocument();
DataSet myDS = new DataSet();
rpt.Load(Server.MapPath("emp.rpt"));
myDA.Fill(myDS,"empreg");
rpt.SetDataSource(myDS);
CrystalReportViewer1.ReportSource = rpt;
The report has no tables.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: CrystalDecisions.CrystalReports.Engine.DataSourceException: The report has no tables.
Source Error:
Line 84: myDA.Fill(myDS,"empreg");
Line 85:
Line 86: rpt.SetDataSource(myDS);
Line 87: CrystalReportViewer1.ReportSource = rpt;
Line 88:
Thanks.