简体   繁体   中英

mobile application using xamarin forms and Azure SQL Database

I have built a mobile application using Xamarin forms and my application works fine for 3 days ie it pulls the data from Azure database exactly how I wanted but on 4th day it only pulls 1 item even though there are many. Any idea what is causing problem. I am confused where exactly the problem is, whether with Xamarin part or database part.

I have built a mobile application using Xamarin forms and my application works fine for 3 days ie it pulls the data from Azure database exactly how I wanted but on 4th day it only pulls 1 item even though there are many.

AFAIK, when using offline sync, you could invoke the PullAsync without pass the query ID, then all records would be retrieved from your remote table. While if you specific the query ID, the mobile SDK would perform the incremental sync. For more details, you could refer to here .

I would recommend you use fiddler to capture the network traces when you pull the data in your mobile client. Moreover, you could call the Http table API via postman or the browser for retrieving the data from your remote table as follows to narrow this issue:

Get https://{your-appname}.azurewebsites.net/tables/{table-name}?ZUMO-API-VERSION=2.0.0

Note: If you enable the authentication, you need to specific the x-zumo-auth header with the value via MobileServiceClient.CurrentUser.MobileServiceAuthenticationToken after you invoked the MobileServiceClient.LoginAsync for logging. Moreover, there has the max page size up to 50 for a single GET operation.

Additionally, you need to make sure your remote table records have not been marked as deleted. If you still could not locate this issue, you could update your question with the code snippet to pull the data and the detailed network traces when calling the pull operation.

Here are some useful tutorials, you could refer to them:

30 DAYS OF ZUMO.V2 (AZURE MOBILE APPS): DAY 13 – THE HTTP TABLE INTERFACE

Chapter 3 - Data Access and Offline Sync

The recommended way to connect to the database is using an API that will manage the interaction with the database. The mobile application should consume that API. Try using a .NET API. That should solve the issue.

If you want your application to operate offline also, you can retrieve data using the API and then store it locally using SQLLite, Realm, or Azure Easy Table. Azure Easy Table is the easiest way to do it. Realm is gaining a lot of adoption.

Hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM