Re: "Timeout expired" in ADO.NET



Does the problem go away if you use a different web server?

Does the problem go away if you use a different database server?

It's possible it's some sort of network or machine configuration issue. I
would experiment with using different machines as the web server and
database server, and trying to have the web server and database server be
the same machine.

"Nils Magnus Englund" <nils.magnus.englund@xxxxxxxxx> wrote in message
news:%23bSe7y0wFHA.596@xxxxxxxxxxxxxxxxxxxxxxx
> Hi,
>
> I've sent a similar post earlier - but after no more luck and a lot more
> frustration, I am reposting the issue with some additional information.
>
> It's regarding several web applications on the same server, connecting to
> a SQL Server on another server.
>
> I keep getting the following exception when accessing the database:
>
> -----
> System.Data.SqlClient.SqlException: Timeout expired. The timeout period
> elapsed prior to completion of the operation or the server is not
> responding.
> ----
>
> I am currently using the following code to connect, but I've had the same
> problem with all the different code snippets I've tried, so I doubt the
> problem lies herein:
>
> -----
> using (SqlConnection connection = new SqlConnection(connectionString))
> {
> connection.Open();
> .... data code ....
> connection.Close();
> }
> -----
>
> The problem happens 1-5 times, after I refresh the page enough times, it
> usually goes through. I've seen a number of potential solutions to the
> problem - but none of them fits the problem.
>
> I usually get the exception after not using the system for a while, but I
> haven't experienced when the system is "in use", i.e. when the previous
> request was no more than a couple of minutes ago, and no recompile of the
> application has been done.
>
> I _don't_ get enough connections to exceed the maximum - far from it (when
> I don't get the exception, the connection pooling seems to work fine).
>
> The exception is thrown instantly, not after the default 30 second
> timeout.
>
> And after I had accidentally misconfigured the authentication in the web
> application, the user didn't have access - I got "Login failed for user
> (null)" - what's odd was that I _still_ got the "Timeout expired"
> exception 4-5 times before I finally got the expected "Login failed"
> exception. The "Timeout expired" exception gets thrown even before I
> successfully connect to the database!
>
> Suggestions are very welcome, I've been struggling with this problem off
> and on for several weeks now. It's only a big nuisance during development,
> but naturally, it's a real showstopper for going into production with the
> application(s).
>
>
> Regards,
> Nils Magnus Englund
>
>
>
>
>


.



Relevant Pages

  • Re: write with cURL
    ... execute permissions. ... This is assuming that the PHP script runs ... of potential security risks from other users on the same server. ... web server itself is part of the group. ...
    (alt.php)
  • RE: System.Data.SqlClient "Timeout expired" causing ASP.net web applic
    ... There are many values here that can shutdown the aspnet_wp. ... > update tables on a Web Server running SQL Server 2000. ... > formation(DataSet currentBalances): Timeout expired. ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • Re: web service architecture question
    ... To assume that we have all the security we will ever need is a bad one. ... ways to breach a server, and the separatin of the web and app server is one ... You can use remoting or web services. ... The web server will be exposed outside the ...
    (microsoft.public.dotnet.framework.webservices)
  • RE: System.Data.SqlClient "Timeout expired" causing ASP.net web applic
    ... There are many values here that can shutdown the aspnet_wp. ... > update tables on a Web Server running SQL Server 2000. ... > formation(DataSet currentBalances): Timeout expired. ...
    (microsoft.public.dotnet.languages.vb)
  • RE: System.Data.SqlClient "Timeout expired" causing ASP.net web applic
    ... There are many values here that can shutdown the aspnet_wp. ... > update tables on a Web Server running SQL Server 2000. ... > formation(DataSet currentBalances): Timeout expired. ...
    (microsoft.public.dotnet.framework.aspnet)