By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,016 Members | 2,265 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,016 IT Pros & Developers. It's quick & easy.

Loss of network connection on Standby.

P: n/a
Hello everybody,

I have been developing an application in Visual Basic.Net that queries
an SQL database every 15 minutes. My problem arises when the computer
upon which the application is running goes into standby mode. My
application continues to run, but when the "15 minutes" timer fires,
it cannot make the required connection to the database and the
application crashes.

What I really need is something to tell me the status of my computer,
to check whether it is on standby before trying to connect to the
database. Error trapping won't do because the application needs to be
able to tell the difference between physically not being connected to
the network and being connected but unable to connect to the database
because of the standby problem.

Thanks in advance,

Tom
\/\/\/\/\/\/\/
Nov 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hello,

"Tom Lant" <th****@ecs.soton.ac.uk> schrieb:
I have been developing an application in Visual Basic
Net that queries an SQL database every 15 minutes.
My problem arises when the computer upon which the
application is running goes into standby mode. My
application continues to run, but when the "15 minutes"
timer fires, it cannot make the required connection to
the database and the application crashes.


This is a VB.NET language group. Notice that you will have a better
chance to get an answer if you post to the ADO.NET newsgroup in future:

news://msnews.microsoft.com/microsof...amework.adonet

Web interface:

http://msdn.microsoft.com/newsgroups...amework.adonet

--
Herfried K. Wagner
MVP VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #2

P: n/a
If it's ok to manually take it out of standby mode, just fire this from
behind yourtimer and send it MonitorOnPrivate Declare Function SendMessage
Lib "user32" Alias "SendMessageA" _
(ByVal hwnd As Long, ByVal wMsg As Long, _
ByVal wParam As Long, lParam As Any) As Long

Public Enum MonitorState
MonitorOn = -1
MonitorOff = 2
MonitorStandby = 1
End Enum

Public Sub SetMonitorState(frmForm As Form, eState As MonitorState)
Dim lngResult As Long

lngResult = SendMessage(frmForm.hwnd, &H112, &HF170, eState)
End Sub
"Tom Lant" <th****@ecs.soton.ac.uk> wrote in message
news:43*************************@posting.google.co m...
Hello everybody,

I have been developing an application in Visual Basic.Net that queries
an SQL database every 15 minutes. My problem arises when the computer
upon which the application is running goes into standby mode. My
application continues to run, but when the "15 minutes" timer fires,
it cannot make the required connection to the database and the
application crashes.

What I really need is something to tell me the status of my computer,
to check whether it is on standby before trying to connect to the
database. Error trapping won't do because the application needs to be
able to tell the difference between physically not being connected to
the network and being connected but unable to connect to the database
because of the standby problem.

Thanks in advance,

Tom
\/\/\/\/\/\/\/

Nov 20 '05 #3

P: n/a
Your best bet is to not let the computer go into standby in the first place.

Standby is not really a software issue. It is hardware issue. Each
implementation is different. You would have to get to the level of knowing
what make model of PC you are running on...

"Tom Lant" <th****@ecs.soton.ac.uk> wrote in message
news:43*************************@posting.google.co m...
Hello everybody,

I have been developing an application in Visual Basic.Net that queries
an SQL database every 15 minutes. My problem arises when the computer
upon which the application is running goes into standby mode. My
application continues to run, but when the "15 minutes" timer fires,
it cannot make the required connection to the database and the
application crashes.

What I really need is something to tell me the status of my computer,
to check whether it is on standby before trying to connect to the
database. Error trapping won't do because the application needs to be
able to tell the difference between physically not being connected to
the network and being connected but unable to connect to the database
because of the standby problem.

Thanks in advance,

Tom
\/\/\/\/\/\/\/

Nov 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.