[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

sql guy

1/30/2006 9:59:00 AM

Hi I am writing an app in c# that will create a package and utilise the
executesql task to execute some sql. from these task, i want to trap the
output via a varaible (or any facility available). my code is shown below:

TaskHost thSQLTask = _Package.Executables.Add("STOCK:SQLTask") as TaskHost;
ExecuteSQLTask myExecTask = thSQLTask.InnerObject as
ExecuteSQLTask;

myExecTask.Connection = connectionManegerName;
myExecTask.SqlStatementSource = executableSQLStatement;
myExecTask.SqlStatementSourceType =
SqlStatementSourceType.DirectInput;
myExecTask.ResultSetType = aResultType;
myExecTask.TimeOut = 0;

however, i am not sure how i can get the output of the task since the task
does not expose any property through which i can wireup a variable.

any help please.

1 Answer

Luegisdorf

1/30/2006 3:30:00 PM

0

Hi guy

I could use the connection and/or ODBCConnection class to open a new
connection to your database and execute trough these class your SQL-Command.

best regards
Patrick

"sql guy" wrote:

> Hi I am writing an app in c# that will create a package and utilise the
> executesql task to execute some sql. from these task, i want to trap the
> output via a varaible (or any facility available). my code is shown below:
>
> TaskHost thSQLTask = _Package.Executables.Add("STOCK:SQLTask") as TaskHost;
> ExecuteSQLTask myExecTask = thSQLTask.InnerObject as
> ExecuteSQLTask;
>
> myExecTask.Connection = connectionManegerName;
> myExecTask.SqlStatementSource = executableSQLStatement;
> myExecTask.SqlStatementSourceType =
> SqlStatementSourceType.DirectInput;
> myExecTask.ResultSetType = aResultType;
> myExecTask.TimeOut = 0;
>
> however, i am not sure how i can get the output of the task since the task
> does not expose any property through which i can wireup a variable.
>
> any help please.
>