Load operation failed for query “GetCustomers" of microsfot 's sample RIA project.

 

Hi,

I createad a Silverlight 4 Beta 1 application with Visual Web Developer 2010 Beta 2, using Silverlight Business Application template.
I added an Entity Data Model pointing to AdventureWorks sample database, choosing only Contact table, and then I added a domain service class mapped to Contact entity of AdventureWorks data model (I also selected Enable Editing and Generate associated classes for metadata options).

Now in the Silverlight client application I added a datagrid named ContactGrid and then I loaded data in this way:

ContactContext context = new ContactContext();
ContactGrid.DataContext = context.Contacts;
context.Load(context.GetContactsQuery()); 

I get this error:

Load operation failed for query 'GetContacts'. Remote server error: NotFound.
Error details:
   on System.Windows.Ria.OperationBase.Complete(Exception error)
   on System.Windows.Ria.LoadOperation.Complete(Exception error)
   on System.Windows.Ria.DomainContext.CompleteLoad(IAsyncResult asyncResult)
   on System.Windows.Ria.DomainContext.<>c__DisplayClass17.<Load>b__13(Object )

I noticed that AuthenticationService (created by the project template) is working, and I can create new users and log in.
I'm developing the application on Windows XP SP3.

How can I solve this problem?

 

结局方案链接: http://forums.silverlight.net/forums/p/151112/338168.aspx

I found the problem: in the method GetContacts of ContactService domain service, I was returing all contacts, that are 19972 in AdventureWorks sample database.

If I take only the first 10, everything works fine:

public IQueryable<Contact> GetContacts()
{
return this.ObjectContext.Contacts.Take(10);
}

So I think there's a maximum response length. Where can I configure this maximum length?

 

转载于:https://www.cnblogs.com/timzhangs/archive/2011/01/05/1926136.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值