469,602 Members | 1,826 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,602 developers. It's quick & easy.

Detecting when SQL Server 2005 Express ready to accept connections

Hi All

I have a windows application (written in VB.net 2005) which I update via web
downloads to my clients computers

The downloaded file is saved in a subfolder until the next time the clients
computer is started

An entry in the registry HKCU\Software\Microsoft\Windows\CurrentVersion\Run
launches my Update program on the next windows XP start

My update program often has to connect to SQL Server 2005 Express (On the
same computer) and here is the problem

100% of the time I get the message 'An error has occurred establishing a
connection to the server....... Could not open a connection to SQL Server'

I have gone so far as to repeatedly read the SQL Server log (In my update
program) looking for the sentence.. 'SQL Server is now ready for client
connections'

When this is found I break out of the loop and continue with my update
program code

But I still receive the error message.

If I run the Update program manually (even a few seconds later) all works
fine

If I Log Off the windows user and log back on the
HKCU\Software\Microsoft\Windows\CurrentVersion\Run entry launches my Update
Program and all works fine

Is is only when windows is restarting
How can identify when SQL Server is ready to accept connections in my VB.net
2005 code?

Regards
Steve
Aug 25 '07 #1
1 2067
Steve ,
I noticed the following behavior with one of my apps

Proggy is running and has connection to sql server 2005 , i disconnect the
network cable , a cathed exception occurs when trying to get data from SQL
(obvious )
however if i reconect the network cable and am able to connect with SMS to
sql server from this client , my proggy still blows up with an exception
that a connection could not be established
if i shutdown the proggy and restart everything works fine again .
I guess same thingy happens at your app , and i believe it is due to the way
how the provider works ( i guess it keeps track of a failed connect in some
way , client side connection pool perhaps ?? )
so i guess you first attempt needs to succeed

regards

Michel

"Steve" <ga*****@newsgroups.nospamschreef in bericht
news:Ok**************@TK2MSFTNGP03.phx.gbl...
Hi All

I have a windows application (written in VB.net 2005) which I update via
web downloads to my clients computers

The downloaded file is saved in a subfolder until the next time the
clients computer is started

An entry in the registry
HKCU\Software\Microsoft\Windows\CurrentVersion\Run launches my Update
program on the next windows XP start

My update program often has to connect to SQL Server 2005 Express (On the
same computer) and here is the problem

100% of the time I get the message 'An error has occurred establishing a
connection to the server....... Could not open a connection to SQL Server'

I have gone so far as to repeatedly read the SQL Server log (In my update
program) looking for the sentence.. 'SQL Server is now ready for client
connections'

When this is found I break out of the loop and continue with my update
program code

But I still receive the error message.

If I run the Update program manually (even a few seconds later) all works
fine

If I Log Off the windows user and log back on the
HKCU\Software\Microsoft\Windows\CurrentVersion\Run entry launches my
Update Program and all works fine

Is is only when windows is restarting
How can identify when SQL Server is ready to accept connections in my
VB.net 2005 code?

Regards
Steve

Aug 25 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by MVChauhan | last post: by
3 posts views Thread by Lee T. Hawkins | last post: by
44 posts views Thread by Smokey Grindle | last post: by
reply views Thread by guiromero | last post: by
reply views Thread by devrayhaan | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.