Note that there are some explanatory texts on larger screens.

plurals
  1. POMobileServiceInvalidOperationException When Trying To Retrieve Data From Azure
    primarykey
    data
    text
    <p>This is the method i am using. </p> <pre><code>try { List&lt;Patient&gt; pList = await App.MobileService.GetTable&lt;Patient&gt;().Where( patient =&gt; patient.id == 1).ToListAsync(); foreach (Patient p in pList) { System.Diagnostics.Debug.WriteLine("{0}, {1}", p.id, p.first_name); } } catch (Exception err) { System.Diagnostics.Debug.WriteLine("ERROR! : {0}", err.Message); } </code></pre> <p>Here's the Patient entity.</p> <pre><code>class Patient { public int id { get; set; } public string first_name { get; set; } public string last_name { get; set; } public string middle_name { get; set; } public string nirc { get; set; } public int bed_id { get; set; } } </code></pre> <p>Here's the error i am getting.</p> <pre><code>An exception of type 'System.Net.WebException' occurred in System.Windows.ni.dll and wasn't handled before a managed/native boundary An exception of type 'System.Net.WebException' occurred in System.Windows.ni.dll and wasn't handled before a managed/native boundary An exception of type 'System.Net.WebException' occurred in mscorlib.ni.dll and wasn't handled before a managed/native boundary An exception of type 'Newtonsoft.Json.JsonReaderException' occurred in Newtonsoft.Json.DLL and wasn't handled before a managed/native boundary An exception of type 'Microsoft.WindowsAzure.MobileServices.MobileServiceInvalidOperationException' occurred in Microsoft.Azure.Zumo.WindowsPhone8.Managed.DLL and wasn't handled before a managed/native boundary An exception of type 'Microsoft.WindowsAzure.MobileServices.MobileServiceInvalidOperationException' occurred in mscorlib.ni.dll and wasn't handled before a managed/native boundary An exception of type 'Microsoft.WindowsAzure.MobileServices.MobileServiceInvalidOperationException' occurred in mscorlib.ni.dll and wasn't handled before a managed/native boundary An exception of type 'Microsoft.WindowsAzure.MobileServices.MobileServiceInvalidOperationException' occurred in mscorlib.ni.dll and wasn't handled before a managed/native boundary A first chance exception of type 'Microsoft.WindowsAzure.MobileServices.MobileServiceInvalidOperationException' occurred in mscorlib.ni.dll An exception of type 'Microsoft.WindowsAzure.MobileServices.MobileServiceInvalidOperationException' occurred in mscorlib.ni.dll and wasn't handled before a managed/native boundary </code></pre> <p>When i wrap my method within a TryCatch, i get this message</p> <pre><code>Error : The request could not be completed. () </code></pre> <p>Here's the stack error message</p> <pre><code> at Microsoft.WindowsAzure.MobileServices.MobileServiceClient.CreateMobileServiceException(String errorMessage, IServiceFilterRequest request, IServiceFilterResponse response) at Microsoft.WindowsAzure.MobileServices.MobileServiceClient.ThrowInvalidResponse(IServiceFilterRequest request, IServiceFilterResponse response, JToken body) at Microsoft.WindowsAzure.MobileServices.MobileServiceClient.&lt;RequestAsync&gt;d__f.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() at Microsoft.WindowsAzure.MobileServices.MobileServiceTable.&lt;SendReadAsync&gt;d__0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() at Microsoft.WindowsAzure.MobileServices.MobileServiceTable`1.&lt;EvaluateQueryAsync&gt;d__3`1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() at Microsoft.WindowsAzure.MobileServices.MobileServiceTableQuery`1.&lt;ToListAsync&gt;d__2.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() at PhoneApp1.MainPage.&lt;populate&gt;d__0.MoveNext() </code></pre> <p>A few points to note.</p> <ol> <li>Permission is set to <code>Anybody with the Application Key</code></li> <li>I've added reference to <code>Windows Azure Mobile Services Managed Client</code></li> <li>I've already inserted this code within App.XAML.CS. <code>using Microsoft.WindowsAzure.MobileServices;</code></li> <li>I've already placed this piece of code acquired from <a href="http://www.windowsazure.com/en-us/develop/mobile/tutorials/get-started-with-data-dotnet/" rel="noreferrer"><strong>this</strong></a> website within App.XAML.CS.<br> <code>public static MobileServiceClient MobileService = new MobileServiceClient( AppUrl, AppKey );</code></li> </ol> <p>Why am i unable to connect to my database? I've tried running these codes on a Windows Store Application and it worked. Previously i've done the exact same thing and it worked as well. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload