• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 873
  • Last Modified:

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)
0
VBdotnet2005
Asked:
VBdotnet2005
  • 2
1 Solution
 
Jacques Bourgeois (James Burger)Commented:
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)Commented:
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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now