Re: Avoid application hanging

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



This looks like an easy and good suggestion. I'll try this!
Thank you all for taking the time to reply.

--
Tim De Vogel
S-Data NV
http://www.s-data.be



"allen" <allen@xxxxxxxxxxxxxxxxxxxxxxxxx> schreef in bericht
news:4CE08714-E850-4D6E-BF6D-E7701F35D160@xxxxxxxxxxxxxxxx
You could also use the System.Net.Dns class to determine the current IP
address for the device. anything other than 127.0.0.1, and you should
have a
valid network connection.

sample code would look something like:

IPHostEntry hostInfo = Dns.GetHostByName(Dns.GetHostName());

if ((hostInfo != null) && (hostInfo.AddressList != null) &&
(hostInfo.AddressList.Length > 0)) {
if (0 != string.Compare("127.0.0.1",
hostInfo.AddressList[0].ToString(), false, CultureInfo.CurrentUICulture) {
// valid network connection
}
else {
// invalid network connection
}
}
else {
// invalid network connection
}



"Tim De Vogel" wrote:

Hi,

I developed a pocketpc application that connects directly to a SQL Server
(so not the mobile CE edition) usign wifi. My problem is that when the
server / wifi is unavailable (due to bad connection, server restart or
whatever) the mobile application hangs, even with a try.. catch around
the
connection parts. Is there a clean way to "detect" for the sql server
availability or to at least make sure my application doesn't hang and
gives
a proper msgbox failure instead of having to go to memory manager to quit
the application?

--
Tim De Vogel
S-Data NV
http://www.s-data.be





.



Relevant Pages

  • RE: Help!!! [Microsoft][ODBC SQL Server Driver]Timeout expired
    ... If network connection issues occur, ... > SQL Server: Microsoft SQL Server 2000 ... > once this error occurrs, all other components which are using "transaction" ... > SQL Server Database. ...
    (microsoft.public.sqlserver.odbc)
  • Re: Avoid application hanging
    ... you have to handle the case where the network connection might not be ... I developed a pocketpc application that connects directly to a SQL Server ... usign wifi. ... whatever) the mobile application hangs, ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Manually writing updatecommands for the data adapter
    ... Tim De Vogel ... Dim objRow As DataRow ... Dim strUpdate As String ...
    (microsoft.public.dotnet.framework.adonet)