How can I read data from a table in Microsoft Azure Mobile Services and put it into my application?

I am using Xamarin Studio and Microsoft Azure Mobile Services. I am trying to read data that I put into a table in Microsoft Azure Mobile Service and display it in my application. I've followed all the tutorials on the Azure website, but I can't find how to simply get data from a table. I want to show the User what they have entered into the table.

Here is my code for entering data into a table:

//this just sets up the connection and table
private static readonly MobileServiceClient MobileService = 
        new MobileServiceClient (UsersConstants.ApplicationURL, UsersConstants.ApplicationKey);
private readonly IMobileServiceTable<UsersTable> usersTable = MobileService.GetTable<UsersTable>();

//this creates a new item 
var NewItem = new UsersTable ();
NewItem.Name = NameTextBox.Text;
NewItem.Email = EmailTextBox.Text;
NewItem.Password = PasswordTextBox.Text;

//this inserts the item into the table I have set up
usersTable.InsertAsync(NewItem);

      

Then I switch to another view in my app (its iOS app) and I want to get this data from the table and put it in my app. I have been looking around but I have not found how to do this. Any help would be greatly appreciated. Thank you!

+3


source to share


1 answer


You should be able to do something like this (the exact syntax may be required for customization)



async private void GetUsers() {

    var users = await usersTable.Where (u => u.Name == "Bob").ToListAsync();

}

      

+1


source







All Articles