Search code examples
sqltimeoutexception

redirecting to log inpage in the case of sqltime out exception


i have developed a web application with asp.net and c#.net and i use sql server DB,

i am getting sql time out exception occasionally, i want to redirect to the loginpage in the case of sqltimeout exception? how can that be done


Solution

  • Wrap the database call in a try/catch. If it times out, use the Response.Redirect() command.