Wednesday, March 21, 2012

Problem getting DTS object to work on a Web form

Hi;

I would like to run a DTS package from the On click button event on a web form.

I tried using code that works in a windows form.

But ASP.net, VS 2005 doesn't like the code.

Here are the libraries that I used with the windows form.

Imports System,Imports System.Data.Imports System.Data.SqlClient.

Is there a library that I am missing ?

And here are the lines of code that won't compile:

Dim oPackageAsNew DTS.Package2Class

Dim oStepAs DTS.Step

Package.LoadFromSQLServer("123WXYZ\TRSQL", , , DTS.DTSSQLServerStorageFlags.DTSSQLStgFlag_UseTrustedConnection, , , ,"cpyPrinters2Excel", )

I am able to run the above in a windows form with no problem.

Thanks for any insights,

Gordon

Hi GMann,

The Imports statement only imports namespaces. It is not add reference to a certain library.

Since you're running DTS packages, you will need to reference the Microsoft DTSPackage Object (COM) Library(DTS.DLL). Use add reference from the Project menu.

HTH. If this does not answer you question, please feel free to mark it as Not Answered and post your reply. Thanks!

|||

These KB articles will be helpful

http://support.microsoft.com/kb/321525/en-us

http://support.microsoft.com/kb/242391/en-us

No comments:

Post a Comment