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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T17:59:15+00:00 2026-06-01T17:59:15+00:00

OK, I’m stumped. I am trying to create a .NET Winforms app to talk

  • 0

OK, I’m stumped. I am trying to create a .NET Winforms app to talk to a database via Entity Framework. I originally created a ASP.NET MVC3 app (with a seperate DAL layer) that can talk to the database after initially failing. SO the first time that it tries to open the connection, it times out. If I then hit F5 in the browser, it connects fine!
I referenced this DAL in my Winforms app.

  • I can connect to the database via SQL Auth in SQL Management Studio fine.
  • I can create the ADO.NET Data classes in VS2010 (it connects, gets the tables and stores the connection string in the app.config).
  • However, once I run the Winforms app, I am unable to connect. I get the mentioned exception with an InnerException of “Timeout expired.”

I copied the connection string from the web.config to the app.config.

The SQL database is hosted on my Windows Home Server called SERVER. I am in a Workgroup (no Domain). I uses SERVER\SQLEXPRESS in Management Studio and VS to successfully connect to it.

Things I’ve tried:

  • Disable the firewall on the client machine.
  • Enabled DTC on the server and added msdtc.exe to the exclusion list on the server.
  • Made sure Named Pipes in enabled on the SQL server instance.
  • Tried different SQL users.
  • Tried different ways of constructing the connection in C#.
  • Generated a new ADO.NET Data class local to my WinForms project (not referencing the DAL). VS connects fine, reads the tables, generates the code. But the running app causes a “Timeout Expired” SqlException.

So running the app is unsuccessful in connecting. When I watch the app in ProcessExplorer I can see an entry in the TCP window when it tries to Connect on remote port 4845 with a SYN_SENT message. Not sure if that’s right.

I’ve google’d and bing’d this for the last few days, I’ve read all the articles and replies here on Stackoverflow that mention this exception, but I have hit a wall.

This is the ConnectionString that VS generated after reading the DB:

<add name="LLDBEntities" connectionString="metadata=res://*/LLDB.csdl|res://*/LLDB.ssdl|res://*/LLDB.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=SERVER\SQLEXPRESS;initial catalog=LLDB;persist security info=True;user id=sa;password=sapwd;multipleactiveresultsets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />

Any help appreciated, even any hints on how to figure out what’s happening.

  • 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-01T17:59:16+00:00Added an answer on June 1, 2026 at 5:59 pm

    Ok, solved.

    I noticed that it would actually connect on the second attempt with the same app and connection. At that point I found this link: http://kromey.us/2011/06/microsoft-sql-server-2008-times-out-on-first-connection-attempt-447.html

    So I opened the firewall port listed under IPAll Dynamic Port in SQL Server Configuration Manager on the TCP/IP Properties for the instance and now it all works fine. I still don’t know why it would get through on the second attempt….

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

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I'm trying to create an if statement in PHP that prevents a single post
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka

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.