VS 2010: SQL timeout exception, SQL Server executes normally

I faced with issues when in VS 2010 I 've got timeout exception, but in MS SQL Server it executes normally. The request is sproc that contains select statement with several joins. What reason, do you have any clues?

Thanks!

Answers


This happend to me once when I forgot to close the connection properly in one new routine that was called a lot.

When max connections was hit on the server, the program got timeout. But of course I could run the query in the query window that allready had a valid connection. Took a while to figure out..

Check activity monitor to see if you have a lots of connections from your client linger around, and if so, check that you close all connections properly.


This usually occurs when the database server does not respond in the default time limit. If you are trying to connect to a remote database location this situation is most probable due to inconsistent network connectivity.

Or this non-responsive behavior can also be caused when there is too much of precessing on the server side either because your query is too complex (having many joins and referencing many views and user-defined functions) or some maintenance operation is in progress on the server side (like database backup etc).

Also, please make sure your connection string has the connection timeout value set like this:

" server=myserver;database=myDatabase;uid=sa;pwd=pass;connection timeout=8; "

here '8' seconds is used as a default timeout limit. 

Another possible solution to this is setting the commandtimetout of command object.

 idbcommand.CommandTimeout = 60000;

Need Your Help

Downloading and decompress a zip-file in the background?

java android

I need to download a zip file and unpack it, in the background (in an AsyncTask I'd imagine).

Randomly iterate through sequence of integers, 1 to n

random integer sequence

I have a range of integers I want to iterate through. You can assume the sequence begins with 1 and ends with n, where n > 1. However, I do not want to iterate through them sequentially. The goa...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.