简体   繁体   English

从Azure移动服务中添加和读取

[英]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.

相关问题 添加GSM功能以连接到azure移动服务 - Adding GSM function to connect to azure mobile service 从Azure移动服务获取信息到Windows 8应用 - Get information from Azure Mobile Service to Windows 8 app 如何从应用程序以管理员身份访问Azure移动服务? - How do I access an Azure Mobile Service as an admin from an app? 来自 EF SQL 的自定义 IQueryable 用于 Azure 移动应用服务 - Custom IQueryable from EF SQL for Azure Mobile App Service 从不同项目访问Windows Phone上的Azure移动服务 - Accessing Azure Mobile Service on Windows Phone from Different Projects 从Azure移动服务将数据检索到Java中的Android应用程序 - Retrieve data from a azure mobile service into a android apllication in java 将azure移动服务api控制器前缀从api更改为表 - change azure mobile service api controller prefix from api to tables Azure函数从服务总线两次读取队列消息 - Azure function reading queue message twice from service bus 在Visual Studio中将Windows Azure移动服务添加到移动应用程序 - Adding Windows Azure Mobile Service to the Mobile Application in Visual Studio 用于每 5 分钟从 Azure SQL 数据库读取数据的控制台应用程序、Windows 服务或 Web 服务? - Console application, windows service, or web service for reading from Azure SQL database every 5 minutes?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM