SQLConnection.connectiontimeout

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • cj

    #1

    SQLConnection.connectiontimeout

    MySQLConnection .connectiontime out() returns 15. I want to drop that to
    3, but it is read only. I see you can include the timeout "Connection
    Timeout=30" as part of the connection string but I don't necessarily
    want it at 3 during the connection--just for queries. Is there a way to
    set it after I'm connected or for it not to affect the connection process?
  • Steven Cheng[MSFT]

    #2
    RE: SQLConnection.c onnectiontimeou t

    Hi Cj,

    As for the SqlConnection's Timeout setting, it should be configured through
    the "Connection Timeout" attribute in connectionstrin g, after the
    SqlConnection object is created, that property is readonly.

    #SqlConnection. ConnectionTimeo ut Property
    http://msdn2.microsoft.com/en-us/lib....sqlconnection
    ..connectiontim eout.aspx

    However, if what you want to do is restrict the timeout period of a certain
    query or update command's execution, you should use use
    SqlCommand.Comm andTimeout property to control the command execution timeout:

    #SqlCommand.Com mandTimeout Property
    http://msdn2.microsoft.com/en-us/lib....sqlcommand.co
    mmandtimeout(VS .80).aspx

    Also, to make use of this CommandTimeout, you need to turn off "Context
    Connection" in the connectionstrin g(as indicated in the above reference).

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead



    =============== =============== =============== =====

    Get notification to my posts through email? Please refer to
    http://msdn.microsoft.com/subscripti...ult.aspx#notif
    ications.



    Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
    where an initial response from the community or a Microsoft Support
    Engineer within 1 business day is acceptable. Please note that each follow
    up response may take approximately 2 business days as the support
    professional working with you may need further investigation to reach the
    most efficient resolution. The offering is not appropriate for situations
    that require urgent, real-time or phone-based interactions or complex
    project analysis and dump analysis issues. Issues of this nature are best
    handled working with a dedicated Microsoft Support Engineer by contacting
    Microsoft Customer Support Services (CSS) at
    http://msdn.microsoft.com/subscripti...t/default.aspx.

    =============== =============== =============== =====



    This posting is provided "AS IS" with no warranties, and confers no rights.




    Comment

    • cj

      #3
      Re: SQLConnection.c onnectiontimeou t

      Thanks, that's what I needed.

      Steven Cheng[MSFT] wrote:
      Hi Cj,
      >
      As for the SqlConnection's Timeout setting, it should be configured through
      the "Connection Timeout" attribute in connectionstrin g, after the
      SqlConnection object is created, that property is readonly.
      >
      #SqlConnection. ConnectionTimeo ut Property
      http://msdn2.microsoft.com/en-us/lib....sqlconnection
      .connectiontime out.aspx
      >
      However, if what you want to do is restrict the timeout period of a certain
      query or update command's execution, you should use use
      SqlCommand.Comm andTimeout property to control the command execution timeout:
      >
      #SqlCommand.Com mandTimeout Property
      http://msdn2.microsoft.com/en-us/lib....sqlcommand.co
      mmandtimeout(VS .80).aspx
      >
      Also, to make use of this CommandTimeout, you need to turn off "Context
      Connection" in the connectionstrin g(as indicated in the above reference).
      >
      Sincerely,
      >
      Steven Cheng
      >
      Microsoft MSDN Online Support Lead
      >
      >
      >
      =============== =============== =============== =====
      >
      Get notification to my posts through email? Please refer to
      http://msdn.microsoft.com/subscripti...ult.aspx#notif
      ications.
      >
      >
      >
      Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
      where an initial response from the community or a Microsoft Support
      Engineer within 1 business day is acceptable. Please note that each follow
      up response may take approximately 2 business days as the support
      professional working with you may need further investigation to reach the
      most efficient resolution. The offering is not appropriate for situations
      that require urgent, real-time or phone-based interactions or complex
      project analysis and dump analysis issues. Issues of this nature are best
      handled working with a dedicated Microsoft Support Engineer by contacting
      Microsoft Customer Support Services (CSS) at
      http://msdn.microsoft.com/subscripti...t/default.aspx.
      >
      =============== =============== =============== =====
      >
      >
      >
      This posting is provided "AS IS" with no warranties, and confers no rights.
      >
      >
      >
      >

      Comment

      Working...