我怎样才能从微软的Azure移动服务表中读取数据,并把它放在我的应用程序? [英] How can I read data from a table in Microsoft Azure Mobile Services and put it in my application?

查看:166
本文介绍了我怎样才能从微软的Azure移动服务表中读取数据,并把它放在我的应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Xamarin Studio和微软的Azure移动服务。我试图读取数据我微软Azure移动服务投入表,并在我的应用程序显示出来。我跟所有的Azure网站上的教程,但我不能似乎找到了如何做到从表中获取数据。我想显示什么他们进入该表的用户。

I am using Xamarin Studio and Microsoft Azure Mobile Services. I am trying to read data I put into a table in Microsoft Azure Mobile Service and display it in my application. I followed all of the tutorials on the Azure website but I cant seem to find how to just get data from a table. I want to display to the User what they entered into the table.

下面是我的code将数据输入表:

Here is my code for entering data into the 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);

我然后切换到在我的应用另一种看法(其iOS应用程序),我想从表中这些数据,并把它放在我的应用程序。我一直在寻找周围,但我还没有找到如何做到这一点。任何帮助将是AP preciated。谢谢!

I then switch to another view in my application (its an iOS application) and I want to get this data from the table and put it in to my application. I have been looking around but I haven't found how to do it. Any help would be appreciated. Thanks!

推荐答案

您应该能够做这样的事情(确切的语法可能需要调整)

You should be able to do something like this (exact syntax may need tweaking)

async private void GetUsers() {

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

}

这篇关于我怎样才能从微软的Azure移动服务表中读取数据,并把它放在我的应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆