how to detect sql server timeout from .NET application without using catch Exception
        Posted  
        
            by haditeo
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by haditeo
        
        
        
        Published on 2010-04-27T06:44:52Z
        Indexed on 
            2010/04/27
            7:03 UTC
        
        
        Read the original article
        Hit count: 389
        
c#
|sql-server
Hi,
In my current application, i am performing an update by invoking T-SQL Update command. The problem is when the same record is locked by other users at that time.
At .NET application, the application will wait until SQL Server timeout, then it will throw the SqlException timeout.
Is it possible to perform a check first whether a particular record is locked by other process rather than catching the exception ?
Thanks,
hadi teo
Update : The SQL Server version used are 2000 and 2008
© Stack Overflow or respective owner