Getting System.Runtime.InteropServices.COMException

One of my windows app keeps getting this error below. Is it on just a sql time out right? Could it be anything else?

System.Runtime.InteropServices.COMException (0x80040E31): [Microsoft][ODBC SQL Server Driver]Timeout expired
   at ADODB.RecordsetClass.Open(Object Source, Object ActiveConnection, CursorTypeEnum CursorType, LockTypeEnum LockType, Int32 Options)
VBdotnet2005Asked:
Who is Participating?
 
Jacques Bourgeois (James Burger)Connect With a Mentor PresidentCommented:
The Connection object has a ConnectionTimeOut property that is set to 15 seconds by default. That time might have been shortened to something too low somewhere, or you might need to set it to a higher value in some situations.
0
 
VBdotnet2005Author Commented:
How can I set sql time out from code behind?

cmd.commandtimeout = 30 for 30 seconds?
0
 
Jacques Bourgeois (James Burger)PresidentCommented:
Sorry, you did not specify anywhere that you were working with a web application. I have no idea how to deal with these things in ASP.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.