Solved

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

Posted on 2009-07-09
2
1,622 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
2 Comments
 
LVL 24

Accepted Solution

by:
alexey_gusev earned 500 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Need WiFi? Often, there are perfectly good networks that don't have WiFi capability - and there's a need to add it.  - Perhaps you have an Ethernet port into a network but no WiFi nearby. - Perhaps you have a powerline extender and no WiFi at the…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

744 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now