Join the DZone community and get the full member experience.
Join For Free
Deploy and scale data-rich applications in minutes and with ease. Mesosphere DC/OS includes everything you need to elastically run containerized apps and data services in production.
- This post is about parsing data by hand coming back from Azure Mobile Services.
- It does not rely on the MobileServiceCollectionView to populate controls with data.
- Use the code below if you want more control over the parsing of data.
||In a previous post, a friend of mine wanted to manually populate a Windows 8 GridView client using data coming back from Azure Mobile Services.
- Use this technique to manually parse JSON data coming back from Azure Mobile Services
- It gives you fine grained control over the parsing of data coming back.
||You want to manually populate a gridview or similar control by hand. In other words, you want to parse JSON manually, one record at a time. Rather than getting an entire collection, you can use this technique to parse individual columns and rows.
||Use the JSONArray technique outlined below. Use the GetData() code below in the public MySampleDataGroup(JsonObject currGroup) constructor.
- You will need to edit the code as you see below.
- There is the application key
- There is the DNS name
- Both of these items will differ with your own version of Azure Mobile Services
The Code to parse data coming back from Azure Mobile Services
||You get this from the Azure Mobile Services Portal. It is the application key.
||You get this from the Azure Mobile Services Portal. It is the DNS name you get when you create the service.
||A column in your SQL Server Table.
public async void GetData()
// Part of the namespace "System.Net.Http"
HttpClient client = new HttpClient();
// Asynchronously call into the web service
var response = await client.GetAsync(
// Read the data as a big string
var result = await response.Content.ReadAsStringAsync();
// Parse the JSON data
var parsedResponse = JsonArray.Parse(result);
// Convert to a JSON array
JsonArray array = parsedResponse;
foreach (var item in array)
var obj = item.GetObject();
// Extract the text key. Assume there is a “text” column coming back
if (obj.TryGetValue("text", out outValue))
string textValue = outValue.GetString();
- For Andrew:
- The best way to learn all the details of using Azure Mobile Services is to do a lab in the Windows Azure Training Kit.
Discover new technologies simplifying running containers and data services in production with this free eBook by O'Reilly. Courtesy of Mesosphere.
Published at DZone with permission
Bruno Terkaly, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.