Im using Linq and Reportviewer Im trying to bind it so that I can view the results of whats already in my database for id 8 ? not familiar with the syntax for reportviewer
protected void _subRebind(string user)
{
rpt_report.ProcessingMode = ProcessingMode.Local;
rpt_report.Reset();
rpt_report.LocalReport.Dispose();
rpt_report.LocalReport.DataSources.Clear();
ReportDataSource LabResults = new ReportDataSource();
LabResults.Name = "LabResults";
DataTable dt = new DataTable();
LabResults.Value = dt;
rpt_report.LocalReport.ReportPath = "Report1.rdlc";
rpt_report.LocalReport.DataSources["LabResults"].Value = objLab.getLabsByID(8);
rpt_report.DataBind();
rpt_report.LocalReport.Refresh();
}
public IQueryable<lab> getLabsByID(int _id)
{
labDataContext objLAB = new labDataContext();
var allLabs = objLAB.labs.Where(x => x.Id == _id).Select(x => x);
return allLabs;
}