wcf ria service 数据显示例程补充
在wcf ria service 1.0 提供的第一个例子,学习使用了一下出现一下问题,逐步解决,顺手记载下来:
1、 当需要加载的数据量太大时,提示 Message: System.ServiceModel.DomainServices.Client.DomainOperationException: Load operation failed for query 'GetHRM_Person'. 远程服务器返回了错误: NotFound。 ---> System.ServiceModel.CommunicationException: 远程服务器返回了错误: NotFound。 ---> 错误,经过网上查找,找到问题所在,因为数据量太大,在web.config中添加system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"
multipleSiteBindingsEnabled="true" />
<behaviors>
<serviceBehaviors>
<behavior>
<dataContractSerializer maxItemsInObjectGraph="2147483647" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
黑体部分,解决数据量大的时候出现的问题。
2、在例子提供的客户端操作中,拖入datagrid后,autocreateColums 属性为false,不会自动创建列,所以,不会自动显示数据
<Grid x:Name="LayoutRoot" Background="White" Height="609" Width="827">
<sdk:DataGrid AutoGenerateColumns="True" Height="585" HorizontalAlignment="Left" Margin="12,12,0,0" Name="dataGrid1" VerticalAlignment="Top" Width="779" />
</Grid>
修改黑体部分字体,可以解决问题。
浙公网安备 33010602011771号