[Microsoft][ODBC SQL Server Driver]Timeout expired yet profiler shows start and end time and no error
Account Home | Help | Blog | Contact us | Log Out


Welcome to Kbytes > Articles

[Microsoft][ODBC SQL Server Driver]Timeout expired yet profiler shows start and end time and no error

Posted By: siteadmin on 25/06/2012 15:04:00

We were getting [Microsoft][ODBC SQL Server Driver]Timeout expired error messages via ado and IIS on a website yet when running the query via Query Analyser it took a long time, but nevertheless worked.

Using Profiler we would see the Start and End times, but still have a web page error.

Many many people out there with the same problem judging by the number of forum entries.

Quite often the commandtimeout parameter would be suggested, so we tried adding to the connection string.

e.g.  DRIVER=SQL Server;POOLING=FALSE;commandTimeout=0;SERVER=etc.etc...

But this is not the only CommandTimeout Parameter available...  There is one in ADO itself.

This site told us how to do it, and so we hope to add a bit of 'Google Power' to it so it appears first in the Google list, rather than further down.

It probably applies to any web scripting language too:

http://www.davidj.org/docs/ado_iis_timeout.html

UPDATE 1:

Seems David J has had a site revamp, and not 301'ed his links, naughty naughty.

Anyway the Archive.org has a copy https://web.archive.org/web/20080327025228/http://www.davidj.org/docs/ado_iis_timeout.html

UPDATE 2:

If you want to do this in ASP.NET with SQLDataAdapter then http://forums.asp.net/t/378898.aspx is where to look.  I can't that JMILLER4 on that thread because the thread is old and locked.  But that is what is needed.

SqlDataAdapter dadData = new SqlDataAdapter(strSQLString, conUS);
dadData.SelectCommand.CommandTimeout=120;

blog comments powered by Disqus

Kbytes Home | Privacy Policy | Contact us | Testing Area

© 2004 - 2024 1 Oak Hill Grove Surbiton Surrey KT6 6DS Phone: +44(020) 8123 1321