C#如何使用LINQ填充水晶报告
作者:互联网
我想用LINQ来填充水晶报告.
这是我的代码:
var results = (from supp in dbdata.Suppliers select supp).ToList();
cr1.Load(@"CrystalReport1.rpt");
cr1.SetDataSource(results);
crystalReportViewer1.ReportSource = cr1;
当我运行应用程序时,它会生成一个错误:
DataSet does not support System.Nullable<>.
我该如何解决?
解决方法:
试试这个 :
CrystalReport1 cr = new CrystalReport1();
var results = (from supp in dbdata.tSamples
where supp.ID == IDNUMBER
select new { supp.Name, supp.Model, supp.Producer }).ToList();
cr.SetDataSource(results);
crystalReportsViewer1.ReportSource = cr;
标签:c,linq,crystal-reports 来源: https://codeday.me/bug/20190704/1373352.html