Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8380985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:35:56+00:00 2026-06-09T16:35:56+00:00

I made two tests, using .NET to connect to Sql Server: I tried to

  • 0

I made two tests, using .NET to connect to Sql Server:

  1. I tried to connect to a local server which is on but the specified database does not exist. In this case it triggers a SqlException with error number 4060 (cannot login with the specified user)
  2. I tried to connect to a local server which process is stopped. In this case it triggers an SqlException with error number -1 (A network-related or instance-specific error occurred while establishing a connection to SQL Server).

In both cases it fails instantly, even though I specified 20 seconds in the connection string. In what situations will it wait the time I told it to wait?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T16:35:58+00:00Added an answer on June 9, 2026 at 4:35 pm

    It sounds like you’ve managed to connect – it’s not like you’re waiting for the network – but you’ve got authentication or authorization problems. I wouldn’t expect that to be part of a connection timeout. The purpose of a connection timeout is to handle network congestion – not to delay authentication failures.

    EDIT: For the second case, the machine would presumably be actively refusing the connection. Again, that’s not network congestion – it’s not the kind of thing that connection timeouts are meant to handle.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I made two classes in which one is main and other one is a
I made two different Fibonacci functions, the first one worked perfectly. Then I tried
Context: .Net, C# I want to print a complex number made from two doubles.
I have a .NET 4 app which consists of the app and two class
I made a xsl merge two xml to one, then using the output to
I made this test to select a row, which I created previously, from two
I've got a web app that uses a MS SQL Server 2008 database. Recently
I have the following procedure, which I'm using to synchronize two MySQL tables: sub
I am writing some tests to automate checking if a database (a MS SQL
I'm putting together a simple test made up of two tutorials available online for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.