473,386 Members | 1,630 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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 2182
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: tony dong | last post by:
Hi there I use vs.net 2005 with standard sql 2005 under machine\sql2005 for instant when I create webpart, the code get from quickstart as follow: <%@ Page Language="C#" %> <%@ Register...
10
by: MVChauhan | last post by:
Hi We are planning to move over to SQL Server 2005 in near future. At the moment Website is on a seperate server then the Database. OS for both the server is Window 2003 and currently our data...
8
by: nick | last post by:
I have only SQL Server 2005 installed on my PC. And I tried to add the following rows in web.config to use SQL Server 2005 instead of Express: <connectionStrings> <clear /> <add...
12
by: Light | last post by:
Hi all, I posted this question in the sqlserver.newusers group but I am not getting any response there so I am going to try it on the fine folks here:). I inherited some legacy ASP codes in my...
3
by: Lee T. Hawkins | last post by:
I am having a number of problems over the last two full days trying to get an ASP.NET 2.0 application to connect to a SQL Server 2005 database... First off, I built this application w/ Visual...
44
by: Smokey Grindle | last post by:
I have a list box on my form, but I need to databind it to a data table that is a private member of the form's class... so I basically have Public Class MyForm priate m_MyTable as new datatable...
10
by: Scott M. | last post by:
I've seen many posts and ready articles discussing how changing the membership & roles "provider" in VS .NET is easy, but have yet to see instructions on how to do it. If I already have SQL...
7
by: RN1 | last post by:
Is it possible to connect to my local SQL Server 2005 database from a remote web server? If yes, what ConnectionString do I use? Thanks, Ron
0
by: mina | last post by:
My application which is written in vb.net 2005 uses sql server 2005 express as a database, this application is multi-user. So i am used 3 xp machine to install my application i can say...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.