Reputation: 1837
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.
Upvotes: 1
Views: 3152
Reputation: 3695
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
Upvotes: 1
Reputation: 2514
What is your Connect timeout? the RemoteQuery Timeout is server defined and measures the elapsed time from EXEC to completion for a task, but connect timeout is client defined. try adding a clause to your connection string like:
Connect Timeout=300;
and see if that affects your error. Here is some info on the differance: http://msdn.microsoft.com/en-us/library/ms177457%28v=SQL.90%29.aspx http://vyaskn.tripod.com/watch_your_timeouts.htm
Upvotes: 1