I completely succeeded in creating a package that sends result set as Email. But the issue here is type of the connection I am using, right now using ADO.NET connection.
But my lead wants to have OLDB connection in order to maintain uniformity across all packages.
Requirement : querying a table having 3 fields, need to send this table content as an Email.
Steps Following : Execute SQL task to store the Result set into a System.Object variable, here connection type using ADO.NET , but my lead wants it as OLDB.
Script task: Using bellow code to load data from system.Object variable to a string variable
Send mail Task : Using string variable ( which was populated in script task) as Message source in Send mail task .
So everything working fine, getting proper email with bellow code in script task. But the issue is if I use OLDB connection type in Execute SQL task instead of ADO.NET
Connection type, Script task is not working . Bellow script is throwing some error . Can anyone please provide script that works for OLDB connection type
To load system.object variable to string variable
Error Message in Script task ( if I use OLDB connection in Execute SQL task instead of Ado.NET)
“Unable to cast COM object of type 'System.__ComObject' to class type 'System.Data.DataSet'. Instances of types that represent COM components cannot be cast to types that do not repr
View Complete Post