-
Hi.. Would be useful too if VB equivalent is posted...
commented on Jul 1 2011 3:25AM
|
-
commented on Jul 1 2011 9:40AM
|
-
commented on Jul 2 2011 2:02PM
|
-
Can we do the same using SQLDataAdaptor?
commented on Nov 16 2011 5:50AM
|
-
Could you please elaborate.
commented on Nov 16 2011 6:06AM
|
-
hi sundeep , can you help me
I am tring the above C# code in script component using it as source
so am reading a object and pushing that in to a datatable
and then am trying to push the datatable in to output buffers , to the mapping out put columns ... can we achieve this if we can can you help me
commented on Jan 4 2012 8:43AM
|
-
Hi akhil,
Can you provide more details as to what you need and what are the input and output sources?
commented on Jan 4 2012 8:54AM
|
-
Thank you. Your example made it easy.
Do you have an example of writing to an object variable?
commented on Jul 14 2012 2:36AM
|
-
commented on Jul 16 2012 3:59AM
|
-
Hi Sudeep,
I'm trying to mimic your C# code as it is and some how i'm getting the below error at this oleDA.Fill(dt, Dts.Variables["users"].Value); statement.
Can you please help me with this?
Error: Object is not an ADODB.RecordSet or an ADODB.Record.
parameter name adodb
commented on Sep 16 2012 12:57PM
|
-
Hi Sam,
How are you populating the object variable?
commented on Sep 16 2012 1:05PM
|
-
System.Collections.ArrayList usernames= new System.Collections.ArrayList();
if
(userslostpercent> 20)
{
usernames.Add(Dts.Variables["usrname"].Value);
}
Dts.Variables["users"].Value = usernames;
commented on Sep 16 2012 9:37PM
|
-
Hi Sam,
It will not read the object variable created by .NET Code. It will read the object variable created by SSIS, either using execute SQL task of Recordset destination in Fata Flow Task.
commented on Sep 17 2012 6:40AM
|
-
@Sam... Dts.Variables["users"].Value is an object variable created by SSIS only. If this is not what you meant please correct me.
System.Collections.ArrayList usernames= new System.Collections.ArrayList();
if (userslostpercent> 20)
{
usernames.Add(Dts.Variables["usrname"].Value); (Dts.Variables["usrname"].Value is a String variable)
}
Dts.Variables["users"].Value = usernames; (usernames is an Arraylist and after this stmt get executed i'm seeing the value in users object variable.)
commented on Sep 17 2012 8:13AM
|
-
Sam, what you are doing here is creating a string array. You cannot read this value from the script I provided in the block. Can you tell me what are you trying to achieve?
commented on Sep 17 2012 8:23AM
|
-
Hi Sudeep,
Thanks for the script to loop through an objects dataset and columns, etc. I use it often to check data in my SSIS object variables.
However, I use my object variables to check for data (simple SQL, like Select Name from Contacts where lastName='Smith') and often, there are no rows returned. Is there a statement like "IsNull(obj)" that I can check?
Otherwise, you will get the error that Sam123 mentions:
Error: Object is not an ADODB.RecordSet or an ADODB.Record. parameter name adodb
Thanks,
schmoot
commented on Oct 1 2012 11:17PM
|
-
Hi Schmoot,
Which version of SSIS are you using? I am doing the same for SSIS 2008 and SSIS 2012 and it works just fine in both SSIS. I tried a query like Select * from tbl where 1=0, This too works with no issues.
commented on Oct 2 2012 1:04PM
|
-
Hi Sudeep,
I'm using SSIS 2008. Basically my question is either how do I check for IsNull(objThing)? Or, if I'm looping through (shredding) objThing, can I exit the process if objThing recordset has no records?
commented on Oct 3 2012 2:16PM
|
-
If I understand your query correctly, if there are no records it will any ways not go into the loop.
commented on Oct 4 2012 2:23AM
|