Thursday 29 September 2011

Increasing Query timeout in .Net C#

SqlCommand command = new SqlCommand(qry, conn);
 command.CommandTimeout = 60 * 60 * 2; //2 hours

By Default CommandTimeout is 60 seconds. If the query is taking more than 60seconds, sqlcommand exits with an error.

No comments:

Post a Comment