Note that there are some explanatory texts on larger screens.

plurals
  1. PORetrieving data from isolated storage windows phone 7
    primarykey
    data
    text
    <p>I am trying to retrieve all the data in my isolated storage alarm.txt. The format of the data saved inside is like this not^no^home^apple^hao^how^.... and so on. And then i will put the split data "not" "no" "home" (3 by 3 and so on) into library items for data binding.</p> <p>For my below code i only managed to get the first 3 data. What should i do to let it continue looping?</p> <p>string[] alarmDetailsSeparated;</p> <pre><code> var isoFile = IsolatedStorageFile.GetUserStoreForApplication(); IsolatedStorageFile myStore = IsolatedStorageFile.GetUserStoreForApplication(); try { StreamReader readFile = new StreamReader(new IsolatedStorageFileStream("AlarmFolder\\alarm.txt", FileMode.Open, myStore)); String fileText = readFile.ReadLine(); //alarmDetailsSeparated is the array that hold the retrieved alarm details from alarm.txt and is split by '^' alarmDetailsSeparated = fileText.Split(new char[] { '^' }); ObservableCollection&lt;Items&gt; LibraryItems = new ObservableCollection&lt;Items&gt;(); for (int i = 0; i &lt; alarmDetailsSeparated.Length; ) { if (test &gt; 0) { i = test; } //To add the alarmDetailsSeparated into the alarmListBox dateSeparate = alarmDetailsSeparated[i]; timeSeparate = alarmDetailsSeparated[i + 1]; labelSeparate = alarmDetailsSeparated[i + 2]; date = dateSeparate; time = timeSeparate; label = labelSeparate; test = test + 3; break; } LibraryItems.Add(new Items(time, label)); alarmListBox.ItemsSource = LibraryItems; } catch (Exception) { } if (alarmListBox.Items.Count == 0) { noAlarmTxtBlock.Visibility = Visibility.Visible; } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload