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 3855768
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T17:49:37+00:00 2026-05-19T17:49:37+00:00

I have a simple piece of code in a .NET console application that tries

  • 0

I have a simple piece of code in a .NET console application that tries to open an SQL connection to a server:

using (SqlConnection connection = new SqlConnection("<my connection string>"))
{
    connection.Open();
}

It works perfectly fine on my Windows 7 machine, but on my other machine running Windows XP x64 the call to Open() hangs indefinitely.

Any ideas why this is happening or how I can diagnose the cause? I am running the program from an administrator account on both computers.

EDIT: Ok, it seems to be a firewall issue. I’ve connected my Windows 7 machine to the same internet connection as the Windows XP machine and now it hangs too… what ports do I need to open to let SQL traffic through, and how do I go about opening them?

EDIT: In case anyone’s interested, my network admin was blocking outgoing traffic to port 1433 out of fear of the Slammer worm …

  • 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-05-19T17:49:38+00:00Added an answer on May 19, 2026 at 5:49 pm

    Since I can ping and attempt to connect to database2.ehost-services.com (though I received a Login failed), let’s try to simplify your connection string:

    Data Source=database2.ehost-services.com;Initial Catalog=myDatabaseName;User ID=myUser;Password=myP@ssword;
    

    EDIT

    To answer your question regarding why your connection string did not time out, MSDN describes the pooling attribute of the connection string as follows:

    When the value of this key is set to
    true, any newly created connection
    will be added to the pool when closed
    by the application. In a next attempt
    to open the same connection, that
    connection will be drawn from the
    pool.

    Connections are considered the same if
    they have the same connection string.
    Different connections have different
    connection strings.

    The value of this key can be “true”,
    “false”, “yes”, or “no”.

    So I’m thinking perhaps your connection instance wasn’t actually pooled yet to time out.

    EDIT

    From your error message it looks like you’re using NAMED PIPES instead of TCP/IP. Maybe this can help you out (use SQL Server Configuration Manager to select your protocol). Check under [SQL Native Client 9.0/10.0 Configuration] and you should see a list of protocols. Make sure TCP/IP is listed with an order before Named Pipes and is also ENABLED. For example, my order of 1 – 3 is Shared Memory, TCP/IP, Named Pipes, and VIA is disabled.

    EDIT

    Try creating an Alias with TCP/IP protocal selected and connecting to your alias? You can do this also using SQL Server Configuration Manager.

    EDIT

    As the OP has resolved the issue, I did make the comment on someone else’s answer:

    A security policy that blocks outgoing
    would have to be explicitly created

    and SOB, that’s what it was – network admin blocked outgoing traffic on port 1433. Glad you figured it out!

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

Sidebar

Related Questions

I have a very simple piece of code that I used in previous versions
Just a simple question on NSStrings, I have a piece of code that assigns
I have a simple piece of code: public string GenerateRandomString() { string randomString =
I have the following piece of code, executing a pretty simple MySQL query: $netnestquery
I have an ASP.NET application that relies on the Random class to generate a
We have a .NET application that needs to pass some data over to a
OneWayToSource Binding seems broken in .NET 4.0 I have this simple piece of Xaml
If I have a simple piece of data to store (an integer or string
Ok, i have simple scenario: have two pages: login and welcome pages. im using
Should simple JavaBeans that have only simple getters and setters be unit tested?? What

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.