I keep around 12 MB of binary data in a SQL Server table. The column that holds this data is of type varbinary(MAX).
When I download this binary data from the server it is OK if I am in the LAN. However I get SQL Server timeout error in my C# application that is trying to get the data.
What could be the reason of getting this error? Remote query timeout property of the database instance is 600 seconds as default. Changing this to zero did not helped.
It is OK to connect and get some other values from the server. For example I first check a DateTime value in the same table to determine if the ~12 MB of data should be downloaded. If content is new then I start execution of downloading the large data.
Are you using System.Data.SqlClient to query? If so, you can adjust the SqlCommand.CommandTimeout value. The default is 30 seconds.
http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.commandtimeout.aspx