Solved

How to resume a hang console job due to lost network connection after the network connection is restored

Posted on 2009-04-13
1
281 Views
Last Modified: 2012-05-06
I wrote a console application that generates the reports in PDF format and exports the reports to a network share folder.  The job is written in VB.NET 2005 and scheduled to run every 2 hours.

Whenever the network connection was lost, the job will be hang until I acknowledge the error manually. Is there a way to resume the job automatically when the network connection is restored?  I used try catch clause in the code to catch the error and email the error to myself, but the email didn't send out neither due to the metwork problem.  

Thanks for help
0
Comment
Question by:jrmc-pgmr
1 Comment
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 250 total points
ID: 24298968
You can use the try catch block to handle the error even if the email can not be sent. Just put the code in try catch blocks and within the catch block, make the thread sleep for a second and then try again.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now