Solved

Getting System.Runtime.InteropServices.COMException

Posted on 2014-01-15
3
787 Views
Last Modified: 2014-01-15
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
Comment
Question by:VBdotnet2005
  • 2
3 Comments
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 500 total points
ID: 39782803
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
 

Author Comment

by:VBdotnet2005
ID: 39782831
How can I set sql time out from code behind?

cmd.commandtimeout = 30 for 30 seconds?
0
 
LVL 40
ID: 39782981
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question