How to pass multiple parameters using ODBC

Posted on 2009-02-22
Last Modified: 2013-12-17
I am calling a report build in sql reporting services. I am using ODBC connection (this is must).
I call this report from a web site using the below code, without parameters its work perfectly fine but when i try to pass two parameters, an exception is coming "Parameter '1/2/2009' does not exist on this report". ODBC use only UNNAMED parameters (?).
how can i set parameters for this.
System.Collections.Generic.List<Microsoft.Reporting.WebForms.ReportParameter> Param = new System.Collections.Generic.List<Microsoft.Reporting.WebForms.ReportParameter>();

        Param.Add(new Microsoft.Reporting.WebForms.ReportParameter("1/2/2009"));

        Param.Add(new Microsoft.Reporting.WebForms.ReportParameter("1/4/2009"));

              System.Uri URL = new System.Uri("http://localhost/ReportServer$MSSQLSERVER2K5");

        rvDailyIVR.ServerReport.ReportServerUrl = URL;

        rvDailyIVR.ServerReport.ReportPath = "/Reports/DailyReport";

        rvDailyIVR.ServerReport.Timeout = 60000;



Open in new window

Question by:wateenitdev
    LVL 19

    Accepted Solution

    It looks to me like your parameter is thinking it is called '1/2/'2009'
    Do you have parametes set iwhich the report expects to receive?  I would think you will need to create a parameter matching this name and having a value of '1/2/'2009'
    LVL 8

    Assisted Solution

    As daveamour said, you will need to create your parameters. You can do this by assigning ReportParameter array to the ServerReport.SetParameters method.

    for reference vist:

    // Forexample if there are two date parameters: StartDate & FinishDate
            ReportParameter startDateParam = new ReportParameter();
            startDateParam.Name = "StartDate";

            ReportParameter finishDateParam = new ReportParameter();
            finishDateParam.Name = "FinishDate";

            // Set the report parameters for the report
                new ReportParameter[] { startDateParam, finishDateParam });

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
    A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now