Reputation: 2581
I have a big table in my SQL Server database with 38000 records! When loading this table in my Silverlight application, it shows 0 records loaded. When I load the same table with less records (1000 for example ) the entity is loaded with all records!
Can anyone help me please?
loadhabitaion = this.friendsContext.Load(this.friendsContext.GetHyd_poliQuery());
loadhabitaion.Completed += new EventHandler(loadhabitaion_Completed);
void loadhabitaion_Completed(object sender, EventArgs e)
{
MessageBox.Show(loadhabitaion.Entities.Count().ToString());
//it returns 0
}
Upvotes: 0
Views: 221
Reputation: 11
Change the configuration file and set the <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
as shown below.
This solved my issue and it will also solve yours.
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="true" />
<!--Added the next line so silverlight could recieve large data chunks-->
<dataContractSerializer maxItemsInObjectGraph="2147483647"/>
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
Upvotes: 1
Reputation: 5944
It has to do with the maximum amount of serialization. Check the Web.config file for this section
<behaviors>
<serviceBehaviors>
<dataContractSerializer maxItemsInObjectGraph="1310720"/>
Upvotes: 1