Home > Archive > MS SQL Server Connectivity > February 2006 > SQL Connection denied after shutdown the Sql PC and restart









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author SQL Connection denied after shutdown the Sql PC and restart
mangia

2006-02-10, 8:23 pm

I have a client PC running a C# program that obtains data from an SQL Server
database. The computer hosting the database is on a local network and is
accessed by using the following connection string: Both computers are
Windows XP SP2.

"Data Source=192.168.20.124,1433;Network Library=DBMSSOCN;Ini
tial
Catalog=CenterDB;Use
r ID=myUserID;Pwd=myPa
ssword;"

The key lines in my code are:
cnPubs = new SqlConnection(...........)
SqlCommand cmdOrder = new SqlCommand("dbo.SC_GetOrderByAC", cnPubs);
cmdOrder.ExecuteNonQuery();

In almost all cases the client can access the database except for a certain
situation. If I shutdown the database computer and restart it, most of the
time the client can access the database without a problem but every so often,
an exception occurs. It is extremely intermittent and hard to duplicate.
The exception that I get is: <SqlException: SQL Server does not exist or
access denied.>

Does anyone have any ideas about what might be causing this intermittent
behavior or what I can try to track down the cause of the problem?
mangia

2006-02-13, 8:23 pm

Correction/update:
1) Both computers are running WinXP SP1 (No firewall and all TCPIP ports are
open)
2) Running MSDE SQL not SQL Server database
3) Roughly 9 times out of 10, if SQL is shutdown, client application cannot
connect to SQL Db when SQL Server is restarted, the Client application must
be restarted.
4) Unable to duplicate errant behavior in development labs running same
software.

Has anyone had similar issues? Does this sound like; .NET garbage
collection, TCPIP settings, client application, client PC, or host SQL Db
PC, or something else?

Chris

"mangia" wrote:

> I have a client PC running a C# program that obtains data from an SQL Server
> database. The computer hosting the database is on a local network and is
> accessed by using the following connection string: Both computers are
> Windows XP SP2.
>
> "Data Source=192.168.20.124,1433;Network Library=DBMSSOCN;Ini
tial
> Catalog=CenterDB;Use
r ID=myUserID;Pwd=myPa
ssword;"
>
> The key lines in my code are:
> cnPubs = new SqlConnection(...........)
> SqlCommand cmdOrder = new SqlCommand("dbo.SC_GetOrderByAC", cnPubs);
> cmdOrder.ExecuteNonQuery();
>
> In almost all cases the client can access the database except for a certain
> situation. If I shutdown the database computer and restart it, most of the
> time the client can access the database without a problem but every so often,
> an exception occurs. It is extremely intermittent and hard to duplicate.
> The exception that I get is: <SqlException: SQL Server does not exist or
> access denied.>
>
> Does anyone have any ideas about what might be causing this intermittent
> behavior or what I can try to track down the cause of the problem?

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com