How to run a DTS package from a webpage in asp.net
-
dear all i have to run a dts package to dump a table's data to a shared drive. i want to provide this facility to my End Users. whenever they want they shd be able to run that DTS on click of a button for this i have done the following code...... Try Dim dtsp As New DTS.Package dtsp.LoadFromSQLServer( _ ServerName:="servername", _ ServerUserName:="UID", _ ServerPassword:="PWD", _ PackageName:="PackageName") dtsp.Execute() Catch ex As Exception lblError.Text = ex.Message End Try when i run it it does not give any error neither it gives me the desired file,which should be generated after running the dts. on the other hand when i run it manually it generates the same. any suggetion
-
dear all i have to run a dts package to dump a table's data to a shared drive. i want to provide this facility to my End Users. whenever they want they shd be able to run that DTS on click of a button for this i have done the following code...... Try Dim dtsp As New DTS.Package dtsp.LoadFromSQLServer( _ ServerName:="servername", _ ServerUserName:="UID", _ ServerPassword:="PWD", _ PackageName:="PackageName") dtsp.Execute() Catch ex As Exception lblError.Text = ex.Message End Try when i run it it does not give any error neither it gives me the desired file,which should be generated after running the dts. on the other hand when i run it manually it generates the same. any suggetion
-
Create a stored procedure and execute the DTS package from with in the stored procedure. then just execute that Stored Procedure from your asp.net page. here is an article that may help[^]
Regards
J O H N :rose:
"Even eagles need a push." David McNally
i have done that also.... SET QUOTED_IDENTIFIER ON GO SET ANSI_NULLS ON GO ALTER PROCEDURE usp_ImportData AS begin DECLARE @DTSRUNCommand as varchar(255) SET @DTSRUNCommand = 'DTSRUN /N ' + 'PackageName /E /S ' + '@@ServerName' EXEC master..xp_cmdshell @DTSRUNCommand end GO SET QUOTED_IDENTIFIER OFF GO SET ANSI_NULLS ON GO it gives me some permission problem. DTSRun: Loading... Error: -2147467259 (80004005); Provider Error: 17 (11) Error string: [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied. Error source: Microsoft OLE DB Provider for SQL Server Help file: Help context: 0 NULL what to do.. i am system admin on the Server. And i have all the rights.