带有winforms的Azure移动服务

时间:2015-06-04 09:13:33

标签: c# azure azure-sql-database azure-mobile-services

我正在尝试使用Microsoft Azure Mobile Service在SQL数据库中插入数据。

不幸的是我没有成功,并且没有找到任何有用的代码。

是否有人对其进行测试并使其正常工作?

我想要做的就是将行插入与我的移动服务相同的Azure SQL表中。

编辑问题解决了!

public static MobileServiceClient MobileService = new MobileServiceClient(
  "https://YOUR-DOMAIN.azure-mobile.net/",
  "YOUR-KEY"
);

public class Item
{
  public string Id { get; set; }
  public string Text { get; set; }
}

private void buttonInsert_Click(object sender, EventArgs e)
{
  Item item = new Item { Text = "Awesome item" };
  MobileService.GetTable<Item>().InsertAsync(item);
}

0 个答案:

没有答案
相关问题