Problems with .NET and DTS

Problems with .NET and DTS

Post by Michael Rame » Sun, 03 Mar 2002 00:41:07



Hi, I'm new to working within .Net, and having problems getting a program I
wrote within VB.net to run properly on another computer.  I've installed the
program, and .Net framework (dotnetfx.exe).

The program loads up great, but when the user clicks a button, which
proceeds to execute a DTS package, the program generates an execption (I've
pasted all the code at the bottom).  Can anyone help me with this?  This DTS
package i'm executing is straight from the VB generated code SQL server DTS
wizard creates, with a few edits ( I had to add .item("blah").value to some
of the oConnectionProperties objects at the beginning, and change .new to
[new] in a goPackage call )

If anyone can help me I would greatly appreciate it, because I'm lost with
this, especially since it runs great on my computer (where I did the
development)

Thanks!,
Michael

----error---

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.InvalidCastException: QueryInterface for interface DTS.CustomTask
failed.
   at DTS.Task.get_CustomTask()
   at PigBLUPgen.HL_EBV_Import.Task_Sub1(Object goPackage)
   at PigBLUPgen.HL_EBV_Import.Main()
   at PigBLUPgen.frmBLUP.btnEBV_Click(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies **************
mscorlib
    Assembly Version: 1.0.3300.0
    Win32 Version: 1.0.3705.0
    CodeBase:
file:///c:/winnt/microsoft.net/framework/v1.0.3705/mscorlib.dll
----------------------------------------
PigBLUPgen
    Assembly Version: 1.0.790.17545
    Win32 Version: 1.0.790.17545
    CodeBase:
file:///C:/Program%20Files/NPD(USA)/PigBLUPgenSetup/PigBLUPgen.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 1.0.3300.0
    Win32 Version: 1.0.3705.0
    CodeBase:
file:///c:/winnt/assembly/gac/system.windows.forms/1.0.3300.0__b77a5c561934e
089/system.windows.forms.dll
----------------------------------------
System
    Assembly Version: 1.0.3300.0
    Win32 Version: 1.0.3705.0
    CodeBase:
file:///c:/winnt/assembly/gac/system/1.0.3300.0__b77a5c561934e089/system.dll
----------------------------------------
System.Drawing
    Assembly Version: 1.0.3300.0
    Win32 Version: 1.0.3705.0
    CodeBase:
file:///c:/winnt/assembly/gac/system.drawing/1.0.3300.0__b03f5f7f11d50a3a/sy
stem.drawing.dll
----------------------------------------
Microsoft.VisualBasic
    Assembly Version: 7.0.3300.0
    Win32 Version: 7.00.9466
    CodeBase:
file:///c:/winnt/assembly/gac/microsoft.visualbasic/7.0.3300.0__b03f5f7f11d5
0a3a/microsoft.visualbasic.dll
----------------------------------------
Interop.Scripting
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase:
file:///C:/Program%20Files/NPD(USA)/PigBLUPgenSetup/Interop.Scripting.DLL
----------------------------------------
ADODB
    Assembly Version: 7.0.3300.0
    Win32 Version: 7.00.9466
    CodeBase: file:///C:/Program%20Files/NPD(USA)/PigBLUPgenSetup/ADODB.DLL
----------------------------------------
Interop.DTS
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.0.0
    CodeBase:
file:///C:/Program%20Files/NPD(USA)/PigBLUPgenSetup/Interop.DTS.DLL
----------------------------------------

************** JIT Debugging **************
To enable just in time (JIT) debugging, the config file for this
application or machine (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT de* registered on the machine
rather than being handled by this dialog.

-----end error-------

 
 
 

Problems with .NET and DTS

Post by Kirk Haselde » Mon, 04 Mar 2002 12:40:52


What version of DTS are you running?  Do you have the latest service pack
release?
Many of these QI problems were fixed in SQL Server 2000 SP2.

http://www.veryComputer.com/

K


Quote:> Hi, I'm new to working within .Net, and having problems getting a program
I
> wrote within VB.net to run properly on another computer.  I've installed
the
> program, and .Net framework (dotnetfx.exe).

> The program loads up great, but when the user clicks a button, which
> proceeds to execute a DTS package, the program generates an execption
(I've
> pasted all the code at the bottom).  Can anyone help me with this?  This
DTS
> package i'm executing is straight from the VB generated code SQL server
DTS
> wizard creates, with a few edits ( I had to add .item("blah").value to
some
> of the oConnectionProperties objects at the beginning, and change .new to
> [new] in a goPackage call )

> If anyone can help me I would greatly appreciate it, because I'm lost with
> this, especially since it runs great on my computer (where I did the
> development)

> Thanks!,
> Michael

> ----error---

> See the end of this message for details on invoking
> just-in-time (JIT) debugging instead of this dialog box.

> ************** Exception Text **************
> System.InvalidCastException: QueryInterface for interface DTS.CustomTask
> failed.
>    at DTS.Task.get_CustomTask()
>    at PigBLUPgen.HL_EBV_Import.Task_Sub1(Object goPackage)
>    at PigBLUPgen.HL_EBV_Import.Main()
>    at PigBLUPgen.frmBLUP.btnEBV_Click(Object sender, EventArgs e)
>    at System.Windows.Forms.Control.OnClick(EventArgs e)
>    at System.Windows.Forms.Button.OnClick(EventArgs e)
>    at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
>    at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
> button, Int32 clicks)
>    at System.Windows.Forms.Control.WndProc(Message& m)
>    at System.Windows.Forms.ButtonBase.WndProc(Message& m)
>    at System.Windows.Forms.Button.WndProc(Message& m)
>    at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
>    at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
>    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
> IntPtr wparam, IntPtr lparam)

> ************** Loaded Assemblies **************
> mscorlib
>     Assembly Version: 1.0.3300.0
>     Win32 Version: 1.0.3705.0
>     CodeBase:
> file:///c:/winnt/microsoft.net/framework/v1.0.3705/mscorlib.dll
> ----------------------------------------
> PigBLUPgen
>     Assembly Version: 1.0.790.17545
>     Win32 Version: 1.0.790.17545
>     CodeBase:
> file:///C:/Program%20Files/NPD(USA)/PigBLUPgenSetup/PigBLUPgen.exe
> ----------------------------------------
> System.Windows.Forms
>     Assembly Version: 1.0.3300.0
>     Win32 Version: 1.0.3705.0
>     CodeBase:

file:///c:/winnt/assembly/gac/system.windows.forms/1.0.3300.0__b77a5c561934e
Quote:> 089/system.windows.forms.dll
> ----------------------------------------
> System
>     Assembly Version: 1.0.3300.0
>     Win32 Version: 1.0.3705.0
>     CodeBase:

file:///c:/winnt/assembly/gac/system/1.0.3300.0__b77a5c561934e089/system.dll
Quote:> ----------------------------------------
> System.Drawing
>     Assembly Version: 1.0.3300.0
>     Win32 Version: 1.0.3705.0
>     CodeBase:

file:///c:/winnt/assembly/gac/system.drawing/1.0.3300.0__b03f5f7f11d50a3a/sy
Quote:> stem.drawing.dll
> ----------------------------------------
> Microsoft.VisualBasic
>     Assembly Version: 7.0.3300.0
>     Win32 Version: 7.00.9466
>     CodeBase:

file:///c:/winnt/assembly/gac/microsoft.visualbasic/7.0.3300.0__b03f5f7f11d5
Quote:> 0a3a/microsoft.visualbasic.dll
> ----------------------------------------
> Interop.Scripting
>     Assembly Version: 1.0.0.0
>     Win32 Version: 1.0.0.0
>     CodeBase:
> file:///C:/Program%20Files/NPD(USA)/PigBLUPgenSetup/Interop.Scripting.DLL
> ----------------------------------------
> ADODB
>     Assembly Version: 7.0.3300.0
>     Win32 Version: 7.00.9466
>     CodeBase:

file:///C:/Program%20Files/NPD(USA)/PigBLUPgenSetup/ADODB.DLL

- Show quoted text -

Quote:> ----------------------------------------
> Interop.DTS
>     Assembly Version: 2.0.0.0
>     Win32 Version: 2.0.0.0
>     CodeBase:
> file:///C:/Program%20Files/NPD(USA)/PigBLUPgenSetup/Interop.DTS.DLL
> ----------------------------------------

> ************** JIT Debugging **************
> To enable just in time (JIT) debugging, the config file for this
> application or machine (machine.config) must have the
> jitDebugging value set in the system.windows.forms section.
> The application must also be compiled with debugging
> enabled.

> For example:

> <configuration>
>     <system.windows.forms jitDebugging="true" />
> </configuration>

> When JIT debugging is enabled, any unhandled exception
> will be sent to the JIT de* registered on the machine
> rather than being handled by this dialog.

> -----end error-------


 
 
 

1. DTS Global Variable problem when working in .NET

Hello,
    I've got a problem when trying to use a global
variable to pass in a data source into a DTS package.  My
problem seems to be .NET specific, as I have done this
many times using VB, but now I am using VB.NET and keep
getting a 'TYPE MISMATCH' Error.

The code I am using in my VB.NET is below.  I have
correct references to DTS.DLL etc.  I have narrowed it
down to passing in the global variable, it all works if I
remove the variable and set a datasource in the package.

dtsImport = New DTS.Package2()

        With dtsImport
            .LoadFromSQLServer(server, us,_
ps, , , , , "DMAZipMatch")
            .GlobalVariables.Item("FileName").Value =
filenm
            .FailOnError = True
            .Execute()
        End With

Any Ideas why I would be getting this 'Type Mismatch'
Error?  Like I said, this works in VB, just not VB.NET

Thanks

2. changing device usage for tempdb

3. Problem Executing DTS Package from VS.net

4. Newbie: Where can I find FoxPro code (samples and support)?

5. DTS problem SQL7->DTS->Excel->DTS->SQL7

6. DAT Tape Drives

7. INSERT into access database using vb.net/ado.net..problem

8. DB2 XML Entender - Content() UDF

9. Problem on ODBC.net on ASP.net

10. Named Pipes connection problem via ASP.NET using ADO.NET

11. Client SDK - Oledb - ADO.Net Multi-Threaded App Problems - VS.Net 2003

12. Client SDK - Oledb - ADO.Net Multi-Threaded App Problems - VS.Net

13. SQL problem, MSDTC Problem or VB.NET problem?