Launch a DTS from Asp.net page

by Emanuele 11/7/2007 2:52:00 PM

Introduction

Data Trasformation Services (DTS) is a tool and set of programmable objects that lets you extract, trasform and consolidate data from various source into various destinations.

How to

Launch a DTS from Asp.net page is much useful, when you must import some data from disparate sources.
First, add reference Microsoft.SqlServer.ManagedDTS to project.
Place into the class the follow using:

using Microsoft.SqlServer.Dts.Runtime;

Now, into the page load event place this code:

string
pkgLocation;
Package pkgImport;
Application appImport;
DTSExecResult pkgResults;

pkgLocation = @"c:\temp\DtsTest.dtsx";
appImport = new Application();
pkgImport = appImport.LoadPackage(pkgLocation, null);
pkgResults = pkgImport.Execute();

if (pkgResults == DTSExecResult.Success)
{
    TxtEsito.text = "DTS Eseguito con successo.";
}

Also we can

Also, we can see the state of job using the follow state enumeration http://msdn2.microsoft.com/en-us/library/microsoft.sqlserver.dts.runtime.dtsexecresult.aspx

Related posts



Powered by BlogEngine.NET 1.3.1.0
Theme by Emanuele Bartolesi

About the author

Name of author Emanuele Bartolesi
I'm a senior developer and project manager.

Contact me Contact me

Calendar

<<  December 2008  >>
MoTuWeThFrSaSu
24252627282930
1234567
891011121314
15161718192021
22232425262728
2930311234

View posts in large calendar

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2008

Sign in

Download Day 2008