Click here to Skip to main content
15,918,808 members
Home / Discussions / Mobile
   

Mobile

 
QuestionPocket PC Registry... Pin
PavanPareta14-Nov-07 21:27
PavanPareta14-Nov-07 21:27 
AnswerRe: Pocket PC Registry... Pin
reyessaez14-Nov-07 22:02
reyessaez14-Nov-07 22:02 
GeneralRe: Pocket PC Registry... Pin
PavanPareta14-Nov-07 22:32
PavanPareta14-Nov-07 22:32 
QuestionHow can i access system date in evc++ Pin
Nikhil Joseph14-Nov-07 17:17
Nikhil Joseph14-Nov-07 17:17 
AnswerRe: How can i access system date in evc++ Pin
Mehmet Suyuti Dindar22-Nov-07 22:32
Mehmet Suyuti Dindar22-Nov-07 22:32 
QuestionCreating af Wizard at Windows Mobile 6 Pin
haolan14-Nov-07 3:46
haolan14-Nov-07 3:46 
Questionhow to use Date Time picker control Pin
gb_my14-Nov-07 0:53
gb_my14-Nov-07 0:53 
Questionwritefile Problem in evc++ 3.0 Pin
gb_my13-Nov-07 20:34
gb_my13-Nov-07 20:34 
AnswerRe: writefile Problem in evc++ 3.0 Pin
João Paulo Figueira13-Nov-07 22:45
professionalJoão Paulo Figueira13-Nov-07 22:45 
GeneralRe: writefile Problem in evc++ 3.0 Pin
gb_my14-Nov-07 0:44
gb_my14-Nov-07 0:44 
QuestionDatabase to use for Windows CE Pin
Brad Wick13-Nov-07 6:38
Brad Wick13-Nov-07 6:38 
AnswerRe: Database to use for Windows CE Pin
João Paulo Figueira13-Nov-07 10:46
professionalJoão Paulo Figueira13-Nov-07 10:46 
GeneralRe: Database to use for Windows CE Pin
Brad Wick14-Nov-07 12:40
Brad Wick14-Nov-07 12:40 
GeneralRe: Database to use for Windows CE Pin
Rocky#15-Nov-07 4:22
Rocky#15-Nov-07 4:22 
Questionhow to add "not read-only" files in a cab Pin
reyessaez13-Nov-07 5:09
reyessaez13-Nov-07 5:09 
Questionhow can i check if there is a wireless network connection? Pin
soruc13-Nov-07 4:45
soruc13-Nov-07 4:45 
QuestionHow to scale the form/controls size Pin
pashitech11-Nov-07 21:40
pashitech11-Nov-07 21:40 
AnswerRe: How to scale the form/controls size Pin
debajyotic20-Nov-07 18:31
debajyotic20-Nov-07 18:31 
QuestionHow to make progressbar's backcolor as transperant Pin
pashitech11-Nov-07 21:35
pashitech11-Nov-07 21:35 
Questioncreating columns Pin
edepede10-Nov-07 8:58
edepede10-Nov-07 8:58 
QuestionSaving data in the background - multi threaded Pin
steve_rm7-Nov-07 4:48
steve_rm7-Nov-07 4:48 
Hello,

VS 2005 Windows Mobile 6.0

I have an application that get data from a web service. This gets done in the main UI thread, as the application cannot move on until this is finished.

However, once the data has been loaded into the dataset, I want to save the contents of the tables in XML on the PDA device itself. It is this that I want to run in the background, so that this form will hide and open another form when this is being done in the background.

Many thanks for any suggestions,

Steve

{<br />
//Load all data into the dataset from the web service<br />
                    this.LoadDataIntoDataSet();<br />
//Create new background thread<br />
                    this.workerThreadSaveXML = new Thread(BackgroundProcessSaveXML);<br />
                    this.workerThreadSaveXML.IsBackground = true;<br />
                    this.workerThreadSaveXML.Start();<br />
                   <br />
                    //THIS SHOULD OPEN THE NEW FORM WHILE THE DATA IS STILL BEING SAVED. <br />
<br />
                    frmOrders objOrders = new frmOrders(DS);<br />
                    objOrders.Show();<br />
                    this.Hide();     <br />
   }


//Load all data into the dataset - NOT RUN IN THE THREAD. THIS HAS TO BE DONE BEFORE THE //NEW FORM WILL OPEN.<br />
        private void LoadDataIntoDataSet()<br />
        {<br />
            try<br />
            {<br />
                DS = ws.GetStarters();<br />
                DS = ws.GetOrders(staffID);<br />
                DS = ws.GetBeverages();<br />
                DS = ws.GetMainCourses();<br />
                DS = ws.GetOrderDetails();<br />
                DS = ws.GetMenus();<br />
            }<br />
            catch (Exception ex)<br />
            {<br />
                MessageBox.Show(ex.Message);<br />
            }<br />
        }


This is will run in the background in saving the data to xml - THIS IS THE IMPORTANT PART AND SHOULD STILL WORK IF THE NEW FORM HAS BEEN OPENED
Code Block

//Save to xml files so that these can be used offline.<br />
       private void BackgroundProcessSaveXML()<br />
       {<br />
           try<br />
           {<br />
               this.LoadStartersData();<br />
               this.LoadBeverageData();<br />
               this.LoadOrdersData(staffID);<br />
               this.LoadMenus();<br />
               this.LoadMaincourse();<br />
           }<br />
           catch (Exception ex)<br />
           {<br />
               MessageBox.Show(ex.Message);<br />
           }<br />
       }


//This is one example of loading the data into the xml file - there are 5 but I have just added on here to save space on the post..


//Load Starters data<br />
        private void LoadStartersData()<br />
        {<br />
            try<br />
            {<br />
                //DS = ws.GetStarters(); <br />
                writeXML.WriteStartersXML(DS);<br />
            }<br />
            catch (Exception ex)<br />
            {<br />
                MessageBox.Show(ex.Message);<br />
            }<br />
        }

QuestionPerformance issue (Is debug mode faster? ) Pin
tusha5-Nov-07 4:12
tusha5-Nov-07 4:12 
AnswerRe: Performance issue (Is debug mode faster? ) Pin
João Paulo Figueira6-Nov-07 21:46
professionalJoão Paulo Figueira6-Nov-07 21:46 
QuestionPlatform Builder 's BSP Wizard problem Pin
TariqZ5-Nov-07 1:06
TariqZ5-Nov-07 1:06 
Questionsend SMS automatic from PC Pin
phuong oanh2-Nov-07 15:12
phuong oanh2-Nov-07 15:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.