Connecting to the Remote Database Table

Before you can perform any operation against a remote database table such as inserting or updating data, you must first connect to a Mobile Service and get a reference to the remote table.

There are two main objects included in the Mobile Services library: the MobileServiceClient object and the MobileServiceTable object. Here’s how you use these two objects to get a reference to the Tasks table:

// Get Tasks table from Azure Mobile Servicesvar mobileServiceClient = new WindowsAzure.MobileServiceClient(    "https://unleashed.azure-mobile.net/",    "IwZcChdiEkqUvZBzPrHCNVifFpVgto72");var tasksTable = mobileServiceClient.getTable('Tasks');

The constructor for the MobileServiceClient ...

Get Windows® 8.1 Apps with HTML5 and JavaScript Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.