Click here to Skip to main content
15,888,590 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have an SSIS package that executes some statements and while they are being executed I get an error window. I need a script that will check all windows and find the error window during the run process and close it automatically when it appears.

I have looked at 2 sets of code but i really dont know how to use them within my script task in my SSIS package. I am a new to c# so would be grateful if someone can help me out. Following are the links to both the codes.

How can I use EnumWindows to find windows with a specific caption/title?

http://www.tcx.be/blog/2006/list-open-windows/

The error window title is "Fatal Error".

Thanks in advance.
Posted

1 solution

Choose whichever of the sets of code you want to use and build it into a DLL. This article[^] will show you how.

This blog article[^] details what to do next to be able to call it from the SSIS package.

Personally, I think this is entirely the wrong way to address the problem.
Find what is causing the error and fix it
OR
Use Try-Catch to handle the error[^] in a meaningful way
 
Share this answer
 
Comments
[no name] 9-Oct-15 9:15am    
ya i guess your right, but for my purpose i need this script to work. i tried following the link, but im not sure if its right or not. No clue what to do next.
CHill60 9-Oct-15 9:30am    
The next thing to do is to look at the "Fatal Error" message, determine which statement is causing it then try to determine why it is happening.
It is highly likely that the stuff at the end of the links (plural) is correct.
If you need the script to work, then simply closing the error message is absolutely the wrong thing to do.
Maciej Los 9-Oct-15 10:39am    
5ed!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900