• As far as the SqlCommand is concerned, there is only one way to set the timeout such that report does not time out - set it to zero. In other words, even though documentation for SQL Server 2005 states to leave it blank, what happens under the hood is that CommandTimeout property, which "gets or sets the wait time in seconds before terminating the attempt to execute a command and generating an error", ends up with the value equal to zero. It has always been like this, even in old ADODB. Too bad that Microsoft changed the usual way of instructing queries not to timeout from the traditional set it to zero to leave it blank in SQL Server 2000/2005 (which will under the hood set it to zero for you).

    With version added, this happens to be a very good question. I missed it because CommandTimeout = 0 seems to be the only way to do it correctly. As a matter of fact, if you use the code to programmatically set the CommandTimeout then there is no GUI to do it for you and you do indeed have to type [yourCommandInstance].CommandTimeout = 0, because in the code it will not accept the value of blank and if you don't explicitly set it then it will get its respective default value, which happens to be 30 seconds. 🙂 This is still true in any version.

    Oleg