Update and Write Back DataTable in Object Variable Using Script Component

Hi All..
I'm trying to update an Object Type Variable [ReadWrite] with a Data Flow Task Script Component. Variable is already holding a record set with Column(s) like, ID, Name, IsProcessed.
Now in my Data Flow Script Component, I'm trying to 1st) Fill a DataTable with my variables value then 2nd) Loop through each Input Rows in Data Flow Component and accordingly if there is a match of ID then updating IsProcessed Column in DataTable. 3rd &Finally,
Copy datatable back to Object Type Variable.
Below is the code used and just for your ref. I tried Printing content of whole DataTable after Update. This looks perfect but not sure why my variable is able to capture it.
using System;
using System.Data;
using System.Data.OleDb;
using Microsoft.SqlServer.Dts.Pipeline.Wrapper;
using Microsoft.SqlServer.Dts.Runtime.Wrapper;
using System.Windows.Forms;
using System.Collections.Generic;
using System.Text;
[Microsoft.SqlServer.Dts.Pipeline.SSISScriptComponentEntryPointAttribute]
public class ScriptMain : UserComponent
DataTable dt = new DataTable();
OleDbDataAdapter adapter = new OleDbDataAdapter();
List<string> listriuid = new List<string>();
public override void PreExecute()
base.PreExecute();
public override void PostExecute()
base.PostExecute();
adapter.Fill(dt, this.Variables.varobjChildPackageLog);
dt.AcceptChanges();
foreach (DataRow row in dt.Rows)
if (listriuid.Contains(row["ID"].ToString()))
row["IsProcessed"] = "Y";
// Just to see the Final Data Table Output
//StringBuilder b = new StringBuilder();
//foreach (System.Data.DataRow r in dt.Rows)
// foreach (DataColumn c in dt.Columns)
// b.Append(c.ColumnName.ToString() + ":" + r[c.ColumnName].ToString());
//MessageBox.Show(b.ToString());
this.Variables.varobjChildPackageLog = dt;
dt.Dispose();
adapter.Dispose();
public override void RIUIDInput_ProcessInputRow(RIUIDInputBuffer Row)
try
listriuid.Add(Row.ID.ToString());
catch (Exception ex)
MessageBox.Show(ex.Message.ToString());
Regards, Avik M.

why do you need to do this in script task.
This is just a matter of using lookup task while you retrive data from source itself to find the matches and use a derived column transform to check and set appropriate value for IsProcessed column. The object variable itself is not required and you dont
even require a looping statement either!
If both source and lookup tables are in same server then you can just wrap them inside source sql query itself to do matching and retrieve the value for IsProcessed within select statement itself in OLEDB Source inside data flow.
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

Similar Messages

  • Just updated the latest Epson software printer update from Apple. Now all my prints look solarized. How do I get rid of the new update and go back to the perfect prints I had before? Help please.

    Just updated the latest Epson software printer update from Apple. Now all my prints look solarized. How do I get rid of the new update and go back to the perfect prints I had before? Help please. Wasting ink and paper at the moment!!!!!!
    I have tried the printer with my laptop (not updated) and everything is fine. It's just the beautiful 27" Imac that can no longer print.

    Might be a corrupted printer preference file ...
    Open the Finder. From the Finder menu bar click Go > Go to Folder
    Type this exactly as you see it here:
    ~/Library/Preferences
    Click Go
    Move the com.apple.PrinterPrefs.plist file from the Preferences folder to the Trash.
    Restart your Mac, restart the printer...

  • I downloaded ios5.1.1 to my phone, but i dont like the new software. The face detection used in the camera jut isnt for me. So, i would like to know if there was a way to undo the update and go back to ios 5.0.1. My iphone is not jailbroken or unlocked.

    i downloaded ios5.1.1 to my phone, but i dont like the new software. The face detection used in the camera jut isnt for me. So, i would like to know if there was a way to undo the update and go back to ios 5.0.1. My iphone is not jailbroken or unlocked.

    The face detection used in the camera jut isnt for me.
    Try a different camera app.  Camera Plus is a good one and there are many others.

  • I just updated my latest java but the update is causing problems with some externale devices. So i would like to uninstall this latest java update and get back the previous one. That should solve to problems with my external device

    i just updated my latest java but the update is causing problems with some external devices. So i would like to uninstall this latest java update and get back the previous one. That should solve to problems with my external device.
    Is this possible and how do i do that?
    Anyone who responds thanks for that!
    Juko
    I am running
    Hardware Overview:
      Model Name:          Mac Pro
      Model Identifier:          MacPro1,1
      Processor Name:          Dual-Core Intel Xeon
      Processor Speed:          2,66 GHz
      Number of Processors:          2
      Total Number of Cores:          4
      L2 Cache (per Processor):          4 MB
      Memory:          6 GB
      Bus Speed:          1,33 GHz
      Boot ROM Version:          MP11.005D.B00
      SMC Version (system):          1.7f10
      Serial Number (system):          CK7XXXXXXGP
      Hardware UUID:          00000000-0000-1000-8000-0017F20F82F0
    System Software Overview:
      System Version:          Mac OS X 10.7.5 (11G63)
      Kernel Version:          Darwin 11.4.2
      Boot Volume:          Macintosh HD(2)
      Boot Mode:          Normal
      Computer Name:          Mac Pro van Juko de Vries
      User Name:          Juko de Vries (jukodevries)
      Secure Virtual Memory:          Enabled
      64-bit Kernel and Extensions:          No
      Time since boot:          11 days 20:39
    Message was edited by Host

    Java 6 you can't as Apple maintains it, and Java 7 you could if you uninstall it and Oracle provides the earlier version which they likely won't his last update fixed 37 remote exploits.
    Java broken some software here and there, all you'll have to do is wait for a update from the other parties.

  • Can I uninstall an update and go back to older the version ?

    hi i have a macbook pro intel and i am using Mac osx 10.5.8, now i have a apple wireless keyboard, recently i just installed the "alluminium keyboard update 2" after which my keypad has stopped responding, i request is some one can offer a help ..... i just want to uninstall this update and go back to the older version .....     

    Hi,
    One simple way would be to completely uninstall your keyboard drivers, updated that they are, and reinstall from scratch, then deny the unwanted updates the right to install.
    Another way is to get details about the culprit by using Terminal and typing the following commands:
    grep swupd /etc/swupd/com.apple.server.swupdate.plist > ~/Desktop/update_list.txt
    (This will get you a list of software updates you've installed on you Mac, in text format, directly on your Desktop)
    Then:
    sudo rm -rf /usr/share/swupd/html/xxx-xxxx/
    (Where "xxx-xxxx" stands for the actual update number you want to delete)
    You'll have to reboot your Mac, and hope that the rollback that will ensue will take place without a glitch. You may find your keyboard unresponsive at first, time for the system to fetch the old driver back from it was stored.

  • I updated to ios 8.3 and i hate it! Is there a way i can uninstall the update and go back to the one before this?

    I updated to ios 8.3 and i hate it! Is there a way i can uninstall the update and go back to the one before this?

    I'm sorry, but Apple does not provide a downgrade path for iOS. Because downgrading is unsupported by Apple we cannot discuss it on these forums.
    You may leave comments at Apple Feedback.

  • HT1444 Is there a way to undo an update and go back to prior version?

    Is there a way to undo an update and go back to a previous version? I installed the latest version of 10.7.4 (?) on my iPhone (4s) but I hate it. I was warned by another user not to update. She said I would regret it. I should've listened.
    1)The Icons are lighter in color with tiny print on them - resembling a bunch of light colored boxes without meaning.
    2) I used to be able to double-click the home button, press-and-hold a running icon at the bottom and deselect all that were running to prolong my battery life, but I can't figure out how to do that now.
    I am reluctant to update my iPad now. I think I will readjust my settings to make the updates "hidden".

    Unfortunately there isn't a downgrade path. However, to improve legibility go to Settings>General>Accessibility and turn 'Larger Type' on and make adjustments there. Also you can turn the 'Bold Text' option on.
    To close down apps, double-tap the Home button as before and any open apps will appear as a reduced sized window of the app. Stroke that window 'up' and the app will close down.

  • HT4623 How can I get rid of this new update and go back to the previous one and how can I register a complaint with Apple?

    How can I get rid of this new 7.0.2 update and go back to the previous one and how can I register a complaint with Apple?

    You can't go back.
    You can leave feedback: http://www.apple.com/feedback

  • How can i delete ios 8 update and go back to ios 7 update

    this ios 8 update is really bad in my opinion, it keeps messing up my phone. can anyone tell me how to delete this update and go back to using my previous update ios 7?

    You cannot. Sorry.
    Pete

  • Read a doc file and write back to a doc file

    How to read line by line from a doc file and then arrange it.
    Like-->
    amit
    sumit
    prem
    jeev
    these four names are present in the doc file. Now how to read by means of java program and sort these names and write back to a new doc file?????
    What packages and methods are to be used??
    Please help.....
    Edited by: Jaguar on Apr 11, 2011 12:16 AM

    Jaguar wrote:
    How to read line by line from a doc file and then arrange it.By 'doc' do you mean MS Word?
    these four names are present in the doc file. Now how to read by means of java program and sort these names and write back to a new doc file?????You seem to have a sticky '?' key and an unreliable shift key (to apply an upper case letter to the start of every sentence). Please fix them.

  • HT4623 I thought I was updating my IPad, i selected update and came back home to the screen frozen with the Itunes symbol and a plug in cord displayed.  I can not get it to do anything.

    I thought I was updating my IPad, i selected update and came back home to the screen frozen with the Itunes symbol and a plug in cord displayed.  I can not get it to do anything.  Any suggestions?

    Your iPad has gone into recovery mode and it needs to be restored now. The instructions are in this kb article.
    If you can't update or restore your iOS device - Support - Apple

  • When I try to watch any video clip I get this:   The version of "Adobe Flash Player" on your system does not include the latest security updates and has been blocked. To continue using "Adobe Flash Player", download an updated version from Adobe's we

    When I try to watch any video clip I get this:
    The version of “Adobe Flash Player” on your system does not include the latest security updates and has been blocked. To continue using “Adobe Flash Player”, download an updated version from Adobe’s website.
    I tried clicking on the Adobe Flash Player.  It said it accepted it but it did not make a difference.
    Can anyone help?
    Thank you!

    This did not work
    On Mon, Oct 27, 2014 at 8:59 PM, Apple Support Communities Updates <

  • The version of "Adobe Flash Player" on your system does not include the latest security updates and has been blocked. To continue using "Adobe Flash Player", download an updated version from Adobe's website.

    The version of “Adobe Flash Player” on your system does not include the latest security updates and has been blocked. To continue using “Adobe Flash Player”, download an updated version from Adobe’s website.

    You haven't actually asked a question, but as stated you should only download Flash Player directy from Adobe.
    Nor have you said what version of OS X and Safari you are running.
    You can check here:  http://www.adobe.com/products/flash/about/  to see which version you should install for your Mac and OS. Note that version 10,1,102,64 is the last version available to PPC Mac users*. The latest version,10.3 or later, is for Intel Macs only, as Adobe no longer support the PPC platform. Version 11.0.1.152 is for Lion.
    * Unhelpfully, if you want the last version for PPC Macs, you need to go here:  http://kb2.adobe.com/cps/142/tn_14266.html  and scroll down to 'Archived Versions/Older Archives'. Flash Player 10.1.102.64 is the one you download. More information here:  http://kb2.adobe.com/cps/838/cpsid_83808.html
    You should first uninstall any previous version of Flash Player, using the uninstaller from here (make sure you use the correct one!):
    http://kb2.adobe.com/cps/909/cpsid_90906.html
    and also that you follow the instructions closely, such as closing ALL applications first before installing. You must also carry out a permission repair after installing anything from Adobe.

  • I was updating app and they froze and never finished the update and know I can't delete neither used the app, how can I resolve this?

    I was updating app and they froze and never finished the update and know I can’t delete neither used the app, how can I resolve this?

    Hi Franklin
    Thanks for your email. I already have done that and not resolve. I try in the iTunes to delete the app in the iPhone and then install again but that not resolve.
    Thanks for your help,
    Ricardo O. Nunes

  • Can I update and sync my new unlocked iphone 4 using iTunes before subscribing to a phone service carrier?

    Can I update and sync my new unlocked iphone 4 using iTunes before first subscribing to a phone service carrier and setting up a phone/data plan?

    Thanks!

Maybe you are looking for

  • Opening Raw files in PE10

    I have current Camera Raw 6.7 update in Photoshop Elements 10. It won't let me open my raw files from my D5200. It says, "cannot open ###.NEF because it is the wrong type of file" however, I can open raw files from my D5100. I have current updates on

  • Searching for a page in the site map

    Hi all! I'm using an older version of Dreamweaver... MX. I'm hoping there's a way to do a search for a specific page using the site map. I have some out-dated pages on a HUGE website I'm trying to clean up for a local organization. I did a search for

  • Airport express setup problem?

    using express to increase range of base station.......several hours of glitches.......now appears to be working, dramatic increase in signal strength from 1 to 10 bars, but amber light still in flashing mode after many resets.........any help appreci

  • How do I save a mp3 file?

    How can I save a free mp3 file to my iPad without using a computer to do so?

  • How can we be sure photos are backed-up on a Window Vista PC?

    If the photos are backed-up, where are they stored?