Click here to Skip to main content
15,889,651 members
Home / Discussions / Mobile
   

Mobile

 
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 
AnswerRe: send SMS automatic from PC Pin
DigiOz Multimedia5-Nov-07 5:38
DigiOz Multimedia5-Nov-07 5:38 
QuestionAre there alternatives to OpenFileDialog?????? Pin
Hurricane30002-Nov-07 7:00
Hurricane30002-Nov-07 7:00 
QuestionIt works on Emulator, does't works on real device..... Pin
Hurricane30002-Nov-07 6:53
Hurricane30002-Nov-07 6:53 
QuestionVB.Net Compact - Reposition form on SID enabled event Pin
mccaber822-Nov-07 5:11
mccaber822-Nov-07 5:11 
AnswerRe: VB.Net Compact - Reposition form on SID enabled event Pin
wizardcode14-Nov-07 2:48
wizardcode14-Nov-07 2:48 
QuestionPlatform builder Pin
subosubo1-Nov-07 18:52
subosubo1-Nov-07 18:52 
QuestionReg Exp Library for Mobile 6 Pin
Jnewg51-Nov-07 12:53
Jnewg51-Nov-07 12:53 
QuestionPocketPC - how do you work these again? Pin
john john mackey1-Nov-07 12:18
john john mackey1-Nov-07 12:18 
AnswerRe: PocketPC - how do you work these again? Pin
João Paulo Figueira6-Nov-07 21:51
professionalJoão Paulo Figueira6-Nov-07 21:51 
GeneralRe: PocketPC - how do you work these again? Pin
john john mackey13-Nov-07 14:43
john john mackey13-Nov-07 14:43 
QuestionJava and netBeans question? Pin
Benny_Lava1-Nov-07 6:05
Benny_Lava1-Nov-07 6:05 
QuestionHow to enlarge an existing bitmap on a VGA device? S.O.S Pin
ttarantula31-Oct-07 23:08
ttarantula31-Oct-07 23:08 
AnswerRe: How to enlarge an existing bitmap on a VGA device? S.O.S Pin
Alain Rist1-Nov-07 8:31
Alain Rist1-Nov-07 8:31 

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.