DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Fri, 27 Jul 2007 08:31:07 -0700,    posted on: microsoft.public.dotnet.framework.adonet        back       

Thread Index
  1    n.phelge
          2    Aaron Bertrand [SQL Server MVP] a


Help - why does SqlException not list Procedure name on timeout?   
When I have a timeout on invoking a stored procedure against SQL
Server, I have an exception returned that looks like the following:

{System.Data.SqlClient.SqlException}
    System.SystemException: {"Timeout expired.  The timeout period
elapsed prior to completion of the operation or the server is not
responding."}
    _errors: {System.Data.SqlClient.SqlErrorCollection}
    Class: 10
    Errors: {System.Data.SqlClient.SqlErrorCollection}
    LineNumber: 0
    Message: "Timeout expired.  The timeout period elapsed prior to
completion of the operation or the server is not responding."
    Number: -2
    Procedure: "ConnectionRead (WrapperRead())."
    Server: ""
    Source: ".Net SqlClient Data Provider"
    State: 0

There no additional information in the Errors collection. The
description of SqlException.Procedure property is as follows:

  Gets the name of the stored procedure or remote procedure call (RPC)
that generated the error.

Is there something I'm missing? I'm trying to put together some
generic logging capabilities, and I had expected that the SqlException
would always provide the name of the stored procedure in the Procedure
property.

Thanks in advance.
Date:Fri, 27 Jul 2007 08:31:07 -0700   Author:  

Re: Help - why does SqlException not list Procedure name on timeout?   
This relies on the message that comes back from SQL Server, which AFAIK does 
not include the procedure name in the case of a timeout.  If you have a 
try{}catch(Exception e){} around a specific call, can't you append the name 
of the procedure you tried to e.Message?  No, it is neither ideal nor 
elegant, but in an ideal world, you would fix the stored procedure so that 
it doesn't time out in the first place.  :-)

-- 
Aaron Bertrand
SQL Server MVP





"n.phelge"  wrote in message 
news:1185550267.354257.320970@z24g2000prh.googlegroups.com...

> When I have a timeout on invoking a stored procedure against SQL
> Server, I have an exception returned that looks like the following:
>
> {System.Data.SqlClient.SqlException}
>    System.SystemException: {"Timeout expired.  The timeout period
> elapsed prior to completion of the operation or the server is not
> responding."}
>    _errors: {System.Data.SqlClient.SqlErrorCollection}
>    Class: 10
>    Errors: {System.Data.SqlClient.SqlErrorCollection}
>    LineNumber: 0
>    Message: "Timeout expired.  The timeout period elapsed prior to
> completion of the operation or the server is not responding."
>    Number: -2
>    Procedure: "ConnectionRead (WrapperRead())."
>    Server: ""
>    Source: ".Net SqlClient Data Provider"
>    State: 0
>
> There no additional information in the Errors collection. The
> description of SqlException.Procedure property is as follows:
>
>  Gets the name of the stored procedure or remote procedure call (RPC)
> that generated the error.
>
> Is there something I'm missing? I'm trying to put together some
> generic logging capabilities, and I had expected that the SqlException
> would always provide the name of the stored procedure in the Procedure
> property.
>
> Thanks in advance.
> 
Date:Fri, 27 Jul 2007 11:40:08 -0400   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us