我使用 Northwind 的 N 层演练创建了一个 VB.Net 解决方案.解决方案奏效了.
I created a VB.Net solution using the N-Tier walkthrough with Northwind. The solution worked.
http://msdn.microsoft.com/en-us/library/bb384570.aspx
然后我使用不同的数据库创建了一个新的解决方案.在 XSD 中,我可以执行查询并显示数据.
I then created a new solution using a different database. In the XSD I can execute the queries and the data appears.
但是,使用 WCF 服务的这些表的表示层中的数据不可用.
However, the data is not available in the Presentation Tier from these tables using the WCF service.
我已将新表导入 Northwind,但它们在 PresentationTier 中不起作用.我已将 Northwind 表导入到我的新数据库中,并且它们确实在 PresentationTier 中工作.
I have imported the new tables to Northwind, and they don't work in the PresentationTier. I have imported the Northwind tables to my new database, and they DO work in the PresentationTier.
我所有的代码都是相似的,没有抛出错误.新表中有数据.
All my code is similar and no errors are thrown. There is data in the new tables.
是否有一些表属性需要修改,以便表不仅可以在 DataAccess/DataEntity 层的 XSD 数据集中通过,而且还可以通过 WCF 在表示层中可用?强>
好的 - 问题似乎与通过 WCF 传入的数据量有关.我测试了不同的行数,结果为 271.
Okay - the problem seems to be related to how much data is coming in through WCF. I tested different row counts and arrived at 271 as the cutoff.
我更改了 SQL Server 数据库中两个字段的值以包含更多数据.
I changed values in two fields in the SQL Server database to contain more data.
对于 WCF 可以将多少数据传送到 PresentationTier,显然存在一个阈值.
There is apparently a threshold on how much data can be carried by WCF to the PresentationTier.
已解决 (???) - 在 PresentationTier 中,右键单击 App.config.
SOLVED (???) - In PresentationTier, right clicked on App.config.
选择了编辑 WCF 配置".关于绑定 - BasicHTTPBinding_IService1 我将 MaxReceivedMessageSize 更改为 65536000,保存并关闭.
Selected 'Edit WCF Configuration'. On Bindings - BasicHTTPBinding_IService1 I cahnged the MaxReceivedMessageSize to 65536000, saved and closed.
双击 PresentationTier - App.config 即可看到新设置 -
Double click on PresentationTier - App.config and you can see the new setting -
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IService1" maxReceivedMessageSize="65536000" />
</basicHttpBinding>
</bindings>
这篇关于一张表在 Presentation Tier 中可用,另一张不可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!