PC Review


Reply
Thread Tools Rate Thread

How to explicit trap a Time Out exception?

 
 
Mario
Guest
Posts: n/a
 
      31st Oct 2005
It seems to me that a "time out" exception is a fairly routine
exception that can occur either when I'm reading from or updating to a
database. That said, it's a bit curious that there is no built-in
exception for trapping a time out.

Presently, I simply trap a vanilla SqlException and then I check the
start of the message for the "Timeout expired." text. If I find it, I
recast the exception using a "new TimeoutException(ex)". I defined
this custom exception myself.

Doesn't it seem practical that the .NET framework would include a
native exception such as TimeoutException or SqlTimeoutException? Why
should I and thousands of other programmer have to parse the message
text?

How are others handling time out exceptions? Am I missing something?

Mario T. Lanza
Clarity Information Architecture, Inc.

 
Reply With Quote
 
 
 
 
Khaled Hussein
Guest
Posts: n/a
 
      1st Nov 2005
Hello Mario,
May I ask if you are working with .NET 1.1 or 2.0?

if you are working with .NET 2.0: I have good news for you and the other
thousands of developers, Microsoft has embedded a new TimeoutException class
and here is its link http://msdn2.microsoft.com/en-us/lib...exception.aspx

if you are using .NET 1.x I guess also that you might have missed something
regarding this exception, Check this link http://msdn.microsoft.com/library/de...classtopic.asp

I am not quite sure of the .NET 1.x exception class if it meets your needs
or not.
Thanks

--
Khaled Hussein
Graduate Teaching Assistant
College of Computing and Information Technology
Arab Academy for Science and Technology and Maritime Transport
Web Site: http://www.aast.edu
(The power of imagination makes us infinite.)

> It seems to me that a "time out" exception is a fairly routine
> exception that can occur either when I'm reading from or updating to a
> database. That said, it's a bit curious that there is no built-in
> exception for trapping a time out.
>
> Presently, I simply trap a vanilla SqlException and then I check the
> start of the message for the "Timeout expired." text. If I find it, I
> recast the exception using a "new TimeoutException(ex)". I defined
> this custom exception myself.
>
> Doesn't it seem practical that the .NET framework would include a
> native exception such as TimeoutException or SqlTimeoutException? Why
> should I and thousands of other programmer have to parse the message
> text?
>
> How are others handling time out exceptions? Am I missing something?
>
> Mario T. Lanza
> Clarity Information Architecture, Inc.



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting a "Logged out" time and "logged in" time to find out the elapsed time PamelaB Microsoft Excel Programming 0 12th Dec 2006 06:05 PM
Explicit Variable Declaration vs Non-Explicit Variable Declaration Navy Seal via AccessMonster.com Microsoft Access Form Coding 1 25th Oct 2006 03:14 PM
Calc. Length of time with time-in, time-out, date-in, date-out in diff. columns Niceven Microsoft Excel Misc 2 28th May 2004 04:31 PM
How to trap System.Web.HttpException: Request timed out.? Jack Wright Microsoft ASP .NET 0 29th Feb 2004 01:13 PM
How to trap System.Web.HttpException: Request timed out.? Jack Wright Microsoft ASP .NET 0 29th Feb 2004 01:13 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:27 AM.