The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,860 other subscribers

.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

via: .net – What is the difference between SqlCommand.CommandTimeout and SqlConnection.ConnectionTimeout? – Stack Overflow.

One Response to “.net – What is the difference between SqlCommand.CommandTimeout and SqlConnection.ConnectionTimeout? – Stack Overflow”

  1. SutoCom Solutions's avatar

    SutoCom said

    Reblogged this on Sutoprise Avenue, A SutoCom Source.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.