When I looked for examples for setting a ReportViewer control's Report and Linq DataSource at runtime I found most included many more steps than necessary.
Here's a short and sweet VB example
' Instantiate a DataContext that contains a table named "Activity"
Dim appData As New AppDataDataContext
' Create a Linq query
Dim query = From a In appData.Activities Select a
' Set the ReportViewer's ReportEmbeddedResource to the report to be shown in the ReportViewer
' Note: The BuidAction propery of the report was set to: EmbeddedResource
Me.ReportViewer1.LocalReport.ReportEmbeddedResource = "VBReportViewerExample.ActivityListReport.rdlc"
' Add a new ReportDataSource to the ReportViewer's DataSources.
' Note: the ToList method is called on the Linq query.
Me.ReportViewer1.LocalReport.DataSources.Add(New ReportDataSource("Activity", query.ToList()))
' Call the ReportViewer's RefreshReport method to show the report.
Me.ReportViewer1.RefreshReport()
Here's a short and sweet C# example:
// This examples is slightly different because it queries agains a stored procedure
// that requires begin date and end date arguments.
DateTime? startDate = DateTime.Now.AddDays(-40);
DateTime? endDate = DateTime.Now.AddDays(40);
// Declare a linq query
var x = from s in DB.VYDal.ScheduledEventsOnDate(startDate, endDate) orderby s.StartTime select s;
// Set the ReportViewer's ReportEmbeddedResource to the report to be shown in the ReportViewer
reportViewer1.LocalReport.ReportEmbeddedResource = "VinoSoft.Reports.Report1.rdlc";
// Add a new ReportDataSource to the ReportViewer's DataSources.
// Note: the ToList method is called on the Linq query.
this.reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("ScheduledEventsOnDateResult", x.ToList()));
// Call the ReportViewer's RefreshReport method to show the report.
reportViewer1.RefreshReport();