Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6731845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:34:38+00:00 2026-05-26T10:34:38+00:00

In my package, I have an Execute Sql Task that sets the result set

  • 0

In my package, I have an Execute Sql Task that sets the result set to a User variable. I then have a c# script task that needs to reference this User variable as a result set. I need the entire result set sent into my script tasks as the web service I am calling needs the entire result set in one shot.

This is the current code I am testing with. It isn’t much as I am still trying to figure out where to go with it.

Any help with this is greatly appreciated

public void Main()
{
    Variable resultSet = Dts.Variables["User::ZBatch_Order_Export_ResultSet"];

    Dts.TaskResult = (int)ScriptResults.Success;
}

This is the update working code:

public void Main()
{
    DataTable dt = new DataTable();
    OleDbDataAdapter oleDa = new OleDbDataAdapter();

    oleDa.Fill(dt, Dts.Variables["User::ZBatch_Order_Export_ResultSet"].Value);

    foreach (DataRow row in dt.Rows)
    {
        Dts.Events
           .FireError(0, "ZBatch - Script Task", row["orderDate"]
           .ToString(), String.Empty, 0);
        // Do some Webservice magic
    }

    Dts.TaskResult = (int)ScriptResults.Success;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T10:34:38+00:00Added an answer on May 26, 2026 at 10:34 am

    So very close, to access the Value of a variable, you need to hit that property

    public void Main()
    {
        Variable resultSet = Dts.Variables["User::ZBatch_Order_Export_ResultSet"].Value;
    
        // do stuff here with resultSet and the webservice
    
        Dts.TaskResult = (int)ScriptResults.Success;
    
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

SSIS (SQL 2005) packages that have a script task that invoke custom .NET dlls
I have the following insert statement in my execute sql task in SSIS: INSERT
I am running an Execute SQL Task statement in my SSIS package. The Execute
I have a large SQL script that creates my database (multiple tables, triggers, and
I have a SQL DTS package running on a SQL Server 2005 database that,
I have an SSIS package that takes data from Tables in an SQL database
I have an SSIS package that is being executed by an SQL Job which
I have a PHP function that calls a PL/SQL package that can throw a
I have an SSIS package that executes several tasks. I manually added an event
I have a package that I just made and I have an old-mode that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.