Groups | Blog | Home
all groups > sql server connect > february 2006 >

sql server connect : SQL Connection denied after shutdown the Sql PC and restart


mangia
2/10/2006 5:03:27 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;Initial
Catalog=CenterDB;User ID=myUserID;Pwd=myPassword;"

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
mangia
2/13/2006 12:37:22 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

[quoted text, click to view]
AddThis Social Bookmark Button