all groups > sql server dts > june 2007 >
You're in the

sql server dts

group:

SSIS: how to show the current status in webform or winform?


SSIS: how to show the current status in webform or winform? Bob Yang
6/28/2007 2:42:44 PM
sql server dts:
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!
Re: SSIS: how to show the current status in webform or winform? Allan Mitchell
6/29/2007 6:42:59 AM
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

[quoted text, click to view]

Re: SSIS: how to show the current status in webform or winform? Bob Yang
7/2/2007 3:41:31 PM
Hi Allan,

thank you! does BOL mean online book?
http://www.microsoft.com/downloads/details.aspx?FamilyID=be6a2c5d-00df-4220-b133-29c1e0b6585f&DisplayLang=en
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!




[quoted text, click to view]

Re: SSIS: how to show the current status in webform or winform? Allan Mitchell
7/3/2007 12:00:00 AM
Hello Bob,


BOL == 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-a1ff-5ff760da7b40.htm

Online

http://www.google.com/search?sourceid=navclient&aq=t&ie=UTF-8&rls=SUNA,SUNA:2006-40,SUNA:en&q=Event+Handlers+in+SSIS

--

Allan Mitchell
http://wiki.sqlis.com | http://www.sqlis.com | http://www.sqldts.com |
http://www.konesans.com

[quoted text, click to view]

Re: SSIS: how to show the current status in webform or winform? Bob Yang
7/3/2007 5:54:02 PM
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]

AddThis Social Bookmark Button