M
Microsoft
Hi
I have a c# program that continually runs 24/7 and performs a variety of
tasks based on a timer.
There is one routine that hangs every Saturday morning without fail. If I
restart the program throughout the week is still hangs. I can restart it
immediatly after the hang and it runs fine until next Saturday.
There is nothing different about Saturday that I can think of.
Any help tracking this down would be appreciated!
Thanks
Robert
Here is the code snip:
af.AddToFile(Constants.c_LogFile,DateTime.Now.ToString() + " Start Grab New
Invoices") ; // Simply writes out to a log file
ds = gds.GrabTheData("NewInvoices"); // ar_GetEmailInvoice01 - Puts data
into a dataset
af.AddToFile(Constants.c_LogFile,DateTime.Now.ToString() + " End Grab New
Invoices") ;
af.AddToFile(Constants.c_LogFile, DateTime.Now.ToString() + " Start For
each");
af.AddToFile(Constants.c_LogFile, DateTime.Now.ToString() + " Start For each
Next");
// ****************************************** HANGS Here or
tempRowCount = ds.Tables[0].Rows.Count;
// ****************************************** HANGS Here
af.AddToFile(Constants.c_LogFile, DateTime.Now.ToString() + " Row Count " +
tempRowCount.ToString() ) ;
foreach (DataRow dr in ds.Tables[0].Rows)
{
af.AddToFile(Constants.c_LogFile,DateTime.Now.ToString() + " Email the
Invoice") ;
CreateInvoice(dr["CustNum"].ToString(),dr["OrdNum"].ToString()) ;
EmailInvoice(dr["CustNum"].ToString(),dr["OrdNum"].ToString()) ;
gds.CustNum = dr["CustNum"].ToString() ;
gds.QuoteNum = dr["OrdNum"].ToString() ;
gds.UpdateTheData("InvoicesEmailed") ;
}
af.AddToFile(Constants.c_LogFile,DateTime.Now.ToString() + " Exiting") ;
I have a c# program that continually runs 24/7 and performs a variety of
tasks based on a timer.
There is one routine that hangs every Saturday morning without fail. If I
restart the program throughout the week is still hangs. I can restart it
immediatly after the hang and it runs fine until next Saturday.
There is nothing different about Saturday that I can think of.
Any help tracking this down would be appreciated!
Thanks
Robert
Here is the code snip:
af.AddToFile(Constants.c_LogFile,DateTime.Now.ToString() + " Start Grab New
Invoices") ; // Simply writes out to a log file
ds = gds.GrabTheData("NewInvoices"); // ar_GetEmailInvoice01 - Puts data
into a dataset
af.AddToFile(Constants.c_LogFile,DateTime.Now.ToString() + " End Grab New
Invoices") ;
af.AddToFile(Constants.c_LogFile, DateTime.Now.ToString() + " Start For
each");
af.AddToFile(Constants.c_LogFile, DateTime.Now.ToString() + " Start For each
Next");
// ****************************************** HANGS Here or
tempRowCount = ds.Tables[0].Rows.Count;
// ****************************************** HANGS Here
af.AddToFile(Constants.c_LogFile, DateTime.Now.ToString() + " Row Count " +
tempRowCount.ToString() ) ;
foreach (DataRow dr in ds.Tables[0].Rows)
{
af.AddToFile(Constants.c_LogFile,DateTime.Now.ToString() + " Email the
Invoice") ;
CreateInvoice(dr["CustNum"].ToString(),dr["OrdNum"].ToString()) ;
EmailInvoice(dr["CustNum"].ToString(),dr["OrdNum"].ToString()) ;
gds.CustNum = dr["CustNum"].ToString() ;
gds.QuoteNum = dr["OrdNum"].ToString() ;
gds.UpdateTheData("InvoicesEmailed") ;
}
af.AddToFile(Constants.c_LogFile,DateTime.Now.ToString() + " Exiting") ;