Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy am I getting this timeout error when I return an ObservableCollection?
    primarykey
    data
    text
    <p>I have a Silverlight app that is getting a list of items from a service on my website. I am passing it as an ObservableCollection with the following function:</p> <pre><code>public ObservableCollection&lt;Dictionary&lt;string, object&gt;&gt; GetItems(string transetDocId) { ObservableCollection&lt;Dictionary&lt;string, object&gt;&gt; result = new ObservableCollection&lt;Dictionary&lt;string, object&gt;&gt;(); foreach (DataRow dr in ((DataTable)HttpContext.Current.Session["ItemDataTable"]).Rows) { Dictionary&lt;string, object&gt; tempD = new Dictionary&lt;string, object&gt;(); foreach (DataColumn dc in ((DataTable)HttpContext.Current.Session["ItemDataTable"]).Columns) tempD.Add(dc.ColumnName, dr[dc.ColumnName]); result.Add(tempD); } return result; } </code></pre> <p>Everything <em>was</em> working fine. And now, with no changes that I can think of, it has started returning the following error. </p> <p>The HTTP request to 'http://www.example.com/Services/Example.svc' has exceeded the allotted timeout. The time allotted to this operation may have been a portion of a longer timeout.</p> <p>I've stepped through the code. I'm firing off the GetItemsAsync() method in the client. The service sees the call, creates the result and returns it. But the GetChecksCompleted() method never gets hit (Yes, I'm adding an event handler). After a few minutes, I get the error.</p> <p>I tried modifying the code so that it returns one long comma/semicolon/pipe delimited string instead of an observable collection and everything runs fine.</p> <p>Why won't the ObservableCollection work?</p> <p>More information: The error I'm getting actually occurs in the generated file Reference.cs in the line right before the return statement:</p> <pre><code>public System.Collections.ObjectModel.ObservableCollection&lt;System.Collections.Generic.Dictionary&lt;string, object&gt;&gt; EndGetItems(System.IAsyncResult result) { object[] _args = new object[0]; System.Collections.ObjectModel.ObservableCollection&lt;System.Collections.Generic.Dictionary&lt;string, object&gt;&gt; _result = ((System.Collections.ObjectModel.ObservableCollection&lt;System.Collections.Generic.Dictionary&lt;string, object&gt;&gt;)(base.EndInvoke("GetItems", _args, result))); return _result; } </code></pre>
    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.
 

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