Cast error in SetParameters RRS feed

  • Question

  • Hi,

    I've searched the forum and tried every variance of code sample that I have seen but I keep getting
    Unable to cast object of type 'Microsoft.Reporting.WebForms.ReportParameter[]' to type 'System.Collections.Generic.IEnumerable`1[Microsoft.Reporting.WinForms.ReportParameter]' when I run my program.

    Could someone help me find out what's wrong with this code ?
    Dim P(1) As ReportParameter
    P(0) = New ReportParameter("Customer", TextBox1.Text.Trim, True)
    P(1) = New ReportParameter("Style", TextBox2.Text.Trim, True)
    ReportViewer1.LocalReport.SetParameters(New ReportParameter() {P(0), P(1)})

    Tuesday, January 15, 2008 3:24 PM

All replies

  • I found the problem, I mistakenly referenced microsoft.reportingservices.webform instead of microsoft.reportingservices.winform
    Tuesday, January 15, 2008 4:26 PM