I have a service that returns a list of values as follows:
Using reader As SqlDataReader = dcmd.ExecuteReader()
While reader.Read()
list.Add(New Entity() With { _
.Field1 = reader("Field1").ToString(), _
.Field2 = reader("Field2").ToString(), _
.Field3 = reader("Field3").ToString() _
})
End While
End Using
conn.Close()
End Using
Return list
End Using
I want to be able to save the Items as separate files in isolated storage in my completed event. How do I do this?
How do I retrieve the data from there as well?
Here's a rough draft of my completed event:
Private Sub GetDataCompleted(ByVal sender As Object, ByVal e As Service.GetDataCompletedEventArgs)
Dim IsolatedStorageFile = IsolatedStorageFile.GetUserStoreForApplication()
Using stream As IsolatedStorageFileStream = file.OpenFile("app.data", System.IO.FileMode.Create)
' write data with writer.Write
Using writer As New StreamWriter(stream)
End Using
End Using
End Using
End Sub
After more research, I see that I can store the data in isolated storage and parse it from there. I need to retrieve certain values and pass them in as parameter.
Haven't figured out how to get the data out of isolated storage yet.
<pre lang="vb">Dim userSettings As IsolatedStorageSettings = _
IsolatedStorageSettings.ApplicationSettings
userSettings.Add("Key", e.Result)