[英]Adding and reading from from azure mobile service
I created a mobile service app using azure connected it to SQL DB that has this table 我使用azure创建了一个移动服务应用程序并将其连接到具有此表的SQL DB
now trying to insert and retrieve data in my Windows Universal App gives me this error: 现在尝试在Windows Universal App中插入和检索数据给我这个错误:
I tried many things one of them was this code: 我尝试了很多事情,其中之一就是这段代码:
HighScore item = new HighScore
{
SCORE = "100",
playerName = "Mark"
};
await App.MobileService.GetTable<HighScore>().InsertAsync(item);
tried also to get the table bu name but no luck, now what is weird for me is that this same code works perfectly on the TodoItem Table but not on other tables. 还尝试获取表bu名称但没有运气,现在对我来说很奇怪的是,该相同的代码可以完美地在TodoItem表上运行,而不能在其他表上运行。
Thanks in advance 提前致谢
The MobileServiceInvalidOperationException
is a wrapper exception. MobileServiceInvalidOperationException
是包装器异常。 The actual exception is in an InnerException inside that object. 实际的异常位于该对象内部的InnerException中。 Based on the error message, your insert is not working.
根据错误消息,您的插入无法正常工作。
You have provided no information on how you constructed the backend. 您没有提供有关如何构造后端的信息。 Don't forget that you need to create the table in the SQL database and you need to create an appropriate controller for exposing the database table to your mobile client.
不要忘记,您需要在SQL数据库中创建表,并且需要创建适当的控制器以将数据库表公开给移动客户端。
You have not provided any information on what the entity on your mobile client looks like. 您尚未提供有关移动客户端上的实体外观的任何信息。 It needs to match the information you want to send to the backend.
它需要匹配您要发送到后端的信息。
Finally, take a look at my book - http://aka.ms/zumobook - Chapter 3 of the book goes into great detail on the data protocol. 最后,看一看我的书-http://aka.ms/zumobook-本书的第3章详细介绍了数据协议。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.