problem in making connection using rasentry class

Jul 30, 2012 at 2:23 PM

I am working on a smart device application that is written in c# targetting compact framework 3.5.  I need to download files from server in backgrouund.


When the application is loaded, i try to connect with 3G in a function that is called in thread. 5. Problem is that the code does not go to section 
if (connectionStatus == "connected")                {                    //File download logic below                } ----------------------------------------


In page_loadThread tNextSchedule = new Thread(new ThreadStart(ManageNextSchedule));tNextSchedule.Start();


private void ManageNextSchedule()        {            try            {                rasEntries = Ras.Entries;                RasEntry entry = rasEntries[FileNameConstant.WCDMA];                entry.RasStatus += new RasNotificationHandler(entry_RasStatus);                entry.Dial(true);                           }            catch (Exception ex)            {                LogManager.WriteLog("", "homeScreen.Connect3G()", ex.ToString(), LogManager.LogLevel.Error);            }        }


private void entry_RasStatus(int hConn, RasConnState State, RasError ErrorCode)        {            try            {                string connectionStatus = State.ToString().ToLower();                             if (connectionStatus == "connected")                {                    //File download logic below                }            }            catch (Exception ex)            {                            }        }