title: ASP.NET C# reportviewer Parameter
body: <p>I am new to report viwer, I wanted to know that how to pass the select parameter to report viewer and also to data source? I need to pass the start date and end date to the data source for filtering data and also show in report viewer. Anyone suggest?</p>
  
  <pre><code>&gt;     &lt;rsweb:ReportViewer ID="Log_ReportViewer" runat="server" Height="545px" Width="962px" Font-Names="Verdana" Font-Size="8pt"
  &gt; WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt"&gt;
  &gt;         &lt;LocalReport ReportPath="Reporting\ReportRDLC File\LogReport.rdlc"&gt;
  &gt;             &lt;DataSources&gt;
  &gt;                 &lt;rsweb:ReportDataSource DataSourceId="SqlDataSource1" Name="Log" /&gt;
  &gt;             &lt;/DataSources&gt; 
  &gt;         &lt;/LocalReport&gt;
  &gt;     &lt;/rsweb:ReportViewer&gt;
  &gt;     &lt;asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="&lt;%$ ConnectionStrings:InvControlConnectionString %&gt;"
  &gt; ProviderName="&lt;%$
  &gt; ConnectionStrings:InvControlConnectionString.ProviderName %&gt;"
  &gt; SelectCommand="SELECT * FROM logs WHERE log_createDate &gt;= startDate AND log_createDate &gt;= endDate"&gt;
  &gt;         &lt;SelectParameters&gt;
  &gt;             &lt;asp:QueryStringParameter Name="endDate" QueryStringField="endDate" /&gt;
  &gt;             &lt;asp:QueryStringParameter Name="startDate" QueryStringField="startDate" /&gt;
  &gt;         &lt;/SelectParameters&gt;
  &gt;     &lt;/asp:SqlDataSource&gt; &lt;/asp:Content&gt;
  </code></pre>