dbTalk Databases Forums  

running DTS package in .Net-- no errors, but nothing happens?

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss running DTS package in .Net-- no errors, but nothing happens? in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jim Bancroft
 
Posts: n/a

Default running DTS package in .Net-- no errors, but nothing happens? - 07-13-2005 , 07:35 PM






I'm stumped. I've ported the DTS library to my C# application (using the
tips listed at http://SQLDev.Net/DTS/DotNETCookBook.htm) and rewrote my VB6
DTS package code in C#. However, when I execute it nothing happens.

I turned on event log publishing with the "WriteCompletionStatusToNTEventLog
" flag, but all I got was this informational message in the event log:

-------------------
The execution of the following DTS Package succeeded:

<<snipped for brevity>>

Total Execution Time: 0 seconds
Package Steps execution information:
Step 'DTSStep_DTSDataPumpTask_1' was not executed
Step 'DTSStep_DTSExecuteSQLTask_1' was not executed
------------------

I've cut out the boilerplate stuff at top, but rest assured no errors were
reported.

My DTS code is a straight port from what I had in VB6 (which was generated
by the SQL 2000 wizard), with the same flags and everything else. For
instance, here's the C# definition of one of the two steps referred to
above:

DTS.Step2 oStep;
oStep = (DTS.Step2) goPackage.Steps.New();
oStep.Name = "DTSStep_DTSDataPumpTask_1";
oStep.Description = "Transform Data Task: undefined";
oStep.ExecutionStatus = DTS.DTSStepExecStatus.DTSStepExecStat_Waiting;
oStep.TaskName = "DTSTask_DTSDataPumpTask_1";
oStep.CommitSuccess = false;
oStep.RollbackFailure = true;
oStep.ScriptLanguage = "VBScript";
oStep.AddGlobalVariables = true;
oStep.RelativePriority =
DTS.DTSStepRelativePriority.DTSStepRelativePriorit y_Normal;
oStep.CloseConnection = false;
oStep.ExecuteInMainThread = false;
oStep.IsPackageDSORowset = false;
oStep.JoinTransactionIfPresent = true;
oStep.RollbackFailure = true;
goPackage.Steps.Add(oStep);


When it comes time to run the package's Execute() method, it races through,
like it's not even trying.

My DTS code is surrounded in a try-catch statement, and no exceptions are
raised. As an aside, I'm a little concerned with the "ScriptLanguage"
attribute above (not using VBScript in .Net after all), but there's no
"VB.Net" or "C#" attribute in DTS.

I know it's difficult to diagnose what's happening given the incomplete
package I've shown you above....what I was hoping for was general guidance,
or maybe a pointer in the right direction with regard to getting all this to
work in .Net. Has anyone managed to do what I'm trying, and are there
additional debugging steps I can attempt? Thanks for the assistance!




Reply With Quote
  #2  
Old   
Jim Bancroft
 
Posts: n/a

Default Re: running DTS package in .Net-- no errors, but nothing happens? - 07-20-2005 , 12:14 PM






Ok, I found the answer on my own. In the hopes that this helps someone in
the future, I accidentally set the "IsPackageDSORowset" flag to true when I
ported the code, whereas it had been false earlier. That's all it took...


"Jim Bancroft" <asdfsklw (AT) nowhere (DOT) com> wrote

Quote:
I'm stumped. I've ported the DTS library to my C# application (using the
tips listed at http://SQLDev.Net/DTS/DotNETCookBook.htm) and rewrote my
VB6 DTS package code in C#. However, when I execute it nothing happens.

I turned on event log publishing with the
"WriteCompletionStatusToNTEventLog " flag, but all I got was this
informational message in the event log:

-------------------
The execution of the following DTS Package succeeded:

snipped for brevity

Total Execution Time: 0 seconds
Package Steps execution information:
Step 'DTSStep_DTSDataPumpTask_1' was not executed
Step 'DTSStep_DTSExecuteSQLTask_1' was not executed
------------------

I've cut out the boilerplate stuff at top, but rest assured no errors were
reported.

My DTS code is a straight port from what I had in VB6 (which was generated
by the SQL 2000 wizard), with the same flags and everything else. For
instance, here's the C# definition of one of the two steps referred to
above:

DTS.Step2 oStep;
oStep = (DTS.Step2) goPackage.Steps.New();
oStep.Name = "DTSStep_DTSDataPumpTask_1";
oStep.Description = "Transform Data Task: undefined";
oStep.ExecutionStatus = DTS.DTSStepExecStatus.DTSStepExecStat_Waiting;
oStep.TaskName = "DTSTask_DTSDataPumpTask_1";
oStep.CommitSuccess = false;
oStep.RollbackFailure = true;
oStep.ScriptLanguage = "VBScript";
oStep.AddGlobalVariables = true;
oStep.RelativePriority =
DTS.DTSStepRelativePriority.DTSStepRelativePriorit y_Normal;
oStep.CloseConnection = false;
oStep.ExecuteInMainThread = false;
oStep.IsPackageDSORowset = false;
oStep.JoinTransactionIfPresent = true;
oStep.RollbackFailure = true;
goPackage.Steps.Add(oStep);


When it comes time to run the package's Execute() method, it races
through, like it's not even trying.

My DTS code is surrounded in a try-catch statement, and no exceptions are
raised. As an aside, I'm a little concerned with the "ScriptLanguage"
attribute above (not using VBScript in .Net after all), but there's no
"VB.Net" or "C#" attribute in DTS.

I know it's difficult to diagnose what's happening given the incomplete
package I've shown you above....what I was hoping for was general
guidance, or maybe a pointer in the right direction with regard to getting
all this to work in .Net. Has anyone managed to do what I'm trying, and
are there additional debugging steps I can attempt? Thanks for the
assistance!






Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.