[thelist] ASP.NET / MSSQL2K5 - Intermittent Connection Problems

Jacques Capesius Jacques.Capesius at compellent.com
Tue Jul 17 13:28:47 CDT 2007

Hi all,

I have a real head-scratcher here, and I'm hoping it's something obvious
that I'm overlooking. 

I have a whole virtual directory off the root web (IIS), and all my
applications in that directory are displaying weird connectivity
problems with the SQL Server 2005 database they're supposed to talk to.

It seems that whenever an application I am hosting in this directory is
forced to recompile, such as when I perform an iisreset, recompile the
code, what-have-you, when I first run the affected applications, I get a
"SQL Server does not exist or access denied" error.

And then, after five to fifteen minutes or so, the applications just...
start connecting again. Messages show up in SQL Profiler traces and
everything, and the pages connect to the database, query and update
data, all that, just fine. And when I do something like another
iisreset, they stop being able to connect for awhile, repeat, rinse. And
naturally, this is a dev environment, so iisresets and code recompiles
are pretty commonplace.

If it helps, this seems to be occurring only since we've upgraded our
webserver machine from Win2K to Win2K3 and our database from MSSQL2K to
MSSQL2K5. Before the upgrade, they worked fine.

The connection code I'm running is simple:

string server = "myServer";
string database = "myDB";
string uid = "myUser";
string pwd = "myPassword";

SqlConnection conn = new SqlConnection("Server=" + server + ";Database="
+ database + ";User ID=" + uid + ";Password=" + pwd +
catch (SqlException ex) {Response.Write(ex.Message);}

If anybody has any ideas to provide, I would be extremely grateful.

-jacques :)

More information about the thelist mailing list