?
Solved

Connect with GPRS programatically for Window Mobile 5 C#.NET window application

Posted on 2009-07-09
2
Medium Priority
?
1,664 Views
Last Modified: 2013-12-09
I am developing window mobile application in C#.Net. This mobile window application will connect with MSSQL Server using GPRS.
Problem: My Window mobile Application needs GPRS to be connected. As GPRS is not connected by default.  I am looking for the way where I can first check status of GPRS and then if it is in disconnected mode, i can connect it automatically using code.
0
Comment
Question by:mitsdev
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 24

Accepted Solution

by:
alexey_gusev earned 2000 total points
ID: 24818686
you can use OpenNETCF (www.opennetcf.com) library and its COnnectionManager class. Then when you made a connection, you can receive notifications about connection state changes etc.

to check the connectivity status before you first use above class, you can check something like this (vb.net sample, but easily convertible to c#):

            Try
                Dim hostName As String = System.Net.Dns.GetHostName()
                Dim hostEntry As IPHostEntry = System.Net.Dns.GetHostEntry(hostName)
                Dim hostIPAdd As String = hostEntry.AddressList(0).ToString()
                ret = hostIPAdd <> IPAddress.Parse("127.0.0.1").ToString()
            Catch
                ret = False
            End Try

Microsoft.WindowsMobile.Status.SystemState.ConnectionCount (and other similar properties) may or may not have proper value (as in case when you connected via ActiveSync to the desktop)
0

Featured Post

ATEN's HDBaseT Presentation at InfoComm 2017

Hear ATEN Product Manager YT Liang review HDBaseT technology, highlighting ATEN’s latest solutions as they relate to real-world applications during her presentation at the HDBaseT booth at InfoComm 2017.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windows 10 Creator Update has just been released and I have it working very well on my laptop. Read below for issues, fixes and ideas.
This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Suggested Courses

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question