Allan,
thank you! I found this one.
http://technet.microsoft.com/en-us/library/ms136090.aspx Capturing Events from a Running Package
When you run a package programmatically as shown in the preceding
sample, you may also want to capture errors and other events that
occur as the package executes. You can accomplish this by adding a
class that inherits from the DefaultEvents class, and by passing a
reference to that class when you load the package. Although the
following example captures only the OnError event, there are many
other events that the DefaultEvents class lets you capture.
To run a package on the local computer programmatically and capture
package events
Follow the steps in the preceding example to create a project for this
example.
Add the following code in the main routine. The completed console
application should look like the following example.
Run the project. The sample code executes the CalculatedColumns sample
package that is installed with the SQL Server 2005 samples. The result
of package execution is displayed in the console window, along with
any errors that occur.
C# Code
using System;
using Microsoft.SqlServer.Dts.Runtime;
namespace RunFromClientAppWithEventsCS
{
class MyEventListener : DefaultEvents
{
public override bool OnError(DtsObject source, int errorCode,
string subComponent,
string description, string helpFile, int helpContext, string
idofInterfaceWithError)
{
// Add application-specific diagnostics here.
Console.WriteLine("Error in {0}/{1} : {2}", source,
subComponent, description);
return false;
}
}
class Program
{
static void Main(string[] args)
{
string pkgLocation;
Package pkg;
Application app;
DTSExecResult pkgResults;
MyEventListener eventListener =3D new MyEventListener();
pkgLocation =3D
@"C:\Program Files\Microsoft SQL Server\90\Samples\Integration
Services" +
@"\Package Samples\CalculatedColumns Sample\CalculatedColumns
\CalculatedColumns.dtsx";
app =3D new Application();
pkg =3D app.LoadPackage(pkgLocation, eventListener);
pkgResults =3D pkg.Execute(null, null, eventListener, null, null);
Console.WriteLine(pkgResults.ToString());
Console.ReadKey();
}
}
}
[quoted text, click to view] On Jul 2, 10:31 pm, Allan Mitchell <a...@no-spam.sqldts.com> wrote:
> Hello Bob,
>
> BOL =3D=3D Books Online i.e. the Help files
>
> Event Handlers are covered here
>
> In BOL
>
> ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/extran9/html/5c6cb097-6056-49c0-a1f=
f-=AD5ff760da7b40.htm
>
> Online
>
>
http://www.google.com/search?sourceid=3Dnavclient&aq=3Dt&ie=3DUTF-8&rls= =3DSUN...
>
> --
>
> Allan Mitchellhttp://wiki.sqlis.com|http://www.sqlis.com|http://www.sqldt=
s=2Ecom|
http://www.konesans.com >
>
>
> > Hi Allan,
>
> > thank you! does BOL mean online book?
>
> >
http://www.microsoft.com/downloads/details.aspx?FamilyID=3Dbe6a2c5d-00df > > -4220-b133-29c1e0b6585f&DisplayLang=3Den
>
> > if so, I am downloading this new version now. I have read SSIS
>
> > tutoring section in Sep 2005 one but there is no such topic.
>
> > I will use "trap" as keyword to search online too. Please let me know
>
> > if i should use other keywords to search for related information.
>
> > thank you!
>
> > On Jun 28, 8:42 pm, Allan Mitchell <a...@no-spam.sqldts.com> wrote:
>
> >> Hello Bob,
>
> >> You could look to trap the events being raised by SSIS. There is an
> >> example of this in BOL I believe.
>
> >> --
>
> >> Allan
> >> Mitchell
http://wiki.sqlis.com|
http://www.sqlis.com|
http://www.sqldts. > >> com|
http://www.konesans.com >
> >>> I plan to create a windows form or web form to triger SSIS to do
> >>> data inserting.
>
> >>> I can see the current status in "SSIS"->" data flow", but how can I
> >>> make them apper in webform or windows form? or anyway to access that
> >>> information? The web form or winform may update every 3 seconds and
> >>> something look like "3000/7000000 are done" or "24% are done"
>
> >>> thank you!- Hide quoted text -
>
> >> - Show quoted text -- Hide quoted text -
>
> - Show quoted text -