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:
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
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);
© 2004 - 2019 1 Oak Hill Grove Surbiton Surrey KT6 6DS Phone: +44(020)82617371