Hey Guys,
Im pretty new to Scripting in SSIS, but i have worked a fair bit out already, although i am stuck with the following problem.. If anyone can help out that would be great!!
Ok, i have a package that loops through records in a table, and extracts the detailed lines in a For Each loop. and stores them in a variable called DetailRecordSet with an data type of object.
I have a built a script task so that i can send out an email confirmation for each order, and i want to list the details in a HTML Table in the body of the message ( I have read that the standard send mail task wont support this, but found an example of using .NET code to generate the email message which will support it) .
What i want to know is how do i reference the columns in the Object variable so i can extract each line and add it into my string that i am creating with HTML codes.. I
e:( str = "<TABLE> <TR>" + Cstr(Variable for 1st column in recordset) + " </TR>"
if any can help my, that would be most appriciated.. Ive tried all different things that ive found on the net, but nothing is working.
Thanks in Advance
Scotty
To know how to interact with SSIS object variable's underlying type, you need to know the type itself. That is, the type of the "thing" stored by reference in the SSIS object variable.What the actual underlying type of the variable stored in the SSIS variable of type object?
System.Windows.Forms.MessageBox.Show(Dts.Variables("DetailRecordSet").Value.GetType().FullName)
The above MessageBox() will display the underlying type in your script task, excepting Com callable wrappers (of type System.__Object).
|||
Sorry for the late reply Jaegd. but have been away for a few days,,
This object type is System.Object. from the variable section i select the data type to be Object.
I appricate your help still, cause i am still stuck
Thanks
Scotty
|||
As per the previous reply, knowing what is in the object is crucial. From your reply it is a COM object, so I'll guess that it is probably an ADO recordset. IN which case take a look here for some links and pointers - http://blogs.conchango.com/jamiethomson/archive/2005/02/08/SSIS_3A00_-Accessing-a-recordset-in-a-script-task.aspx
If that does not help, then help me, as I don't understand how you got there. So what has populated the variable exactly, and what method was used? If it is the For Each loop, what enumerator have you used?
No comments:
Post a Comment