No columns data of a SQL stored procedure in Visual Studio rdlc Report

Posted on 2012-09-06
Last Modified: 2012-09-07

I am trying to create a Dataset (xsd file) for a Report (rdlc file), the datasource for the dataset  is a stored procedure that executes a sql sentence  "exec(@strSQL)" in order to retrieve the desired data, the problem is that in visual studio when I am creating the data set and attach the stored procedure, no columns are obtained in order to keep with the design of the report.

Question by:negreteo
    LVL 23

    Accepted Solution

    When you are executing dynamic SQL, it is impossible for the designer to figure out what the columns of the output are - it can only do this when the stored procedure returns a static query.  Is there a way for you to reengineer the query to fill a table variable or temporary table  and return a SELECT on that table?

    Author Comment

    I did what was recommended by

                insert into #tblResults

                select * from #tblResults

    by executing this query I am able to see the columns and its records but still no columns are retrieved for the report from the datasource

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
    Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    759 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

    13 Experts available now in Live!

    Get 1:1 Help Now