i want to set the querytimeout fromt he connection string. not the connection timeout , is it possible?
+1
A:
See:- ConnectionStrings content on this subject. There is no default command timeout property.
AnthonyWJones
2009-07-29 09:24:04
+1
A:
You can only set the connection timeout on the connection string, the timeout for your query would normally be on the command timeout. (Assuming we are talking .net here, I can't really tell from your question).
However the command timeout has no effect when the command is executed against a context connection (a SqlConnection opened with "context connection=true" in the connection string).
Iain Hoult
2009-07-29 09:32:03
thanks guys , its make sense casue the connection string can be used for other queris
2009-07-29 10:25:53
A:
This work for me:
connectionString = "Server=NoExist;Database=tempdb;User ID=sa;Password=12345678;Connection Timeout=2;"
Sasha
2010-02-07 14:22:57
That's the connection timeout, not command timeout - very different. Iain's answer from 6 months ago explained the distinction, and the OP explicitly called out the fact that he wasn't looking for the connection timeout.
Aaronaught
2010-02-07 14:34:31