.net – What is the difference between SqlCommand.CommandTimeout and SqlConnection.ConnectionTimeout? – Stack Overflow
Posted by jpluimers on 2013/09/04
Lots of people are confused about the different time out options you can set in ADO.NET.
Thanks NinethSense for explaining this well for the SqlClient DAL. Other DALs work in a similar way.
- SqlCommand.CommandTimeout = timeout limit for your SQL query. Means, how much time a (eg: SELECT, UPDATE) query can take for its execution. If it exceeds SqlCommand.CommandTimeout, then it stops execution. A command timeout error will occur.
- SqlConnection.ConnectionTimeout = timeout limit for your connection. Means, how much time your connection object can try to connect. If it exceeds the specified time, it stops connecting. A connection timeout error will occur.
–jeroen
SutoCom said
Reblogged this on Sutoprise Avenue, A SutoCom Source.