"DataPortal_Fetch method call failed"

"DataPortal_Fetch method call failed"

Old forum URL: forums.lhotka.net/forums/t/236.aspx


markmconel posted on Wednesday, May 31, 2006

I'm sure I'm missing something easy but I can't figure out what.

I have implimented a simple NameValueListBase. 

public class TaskServerList : NameValueListBase<int, string>

When I use the regular criteria class everything works properly and DataPortal_Fetch is called.

_list = DataPortal.Fetch<TaskServerList>(new Criteria(typeof(TaskServerList)));

However when I try to use my custom criteria class I get an error message "DataPortal_Fetch method call failed".

_list = DataPortal.Fetch<TaskServerList>(new TaskServerCriteria(typeof(TaskServerList)));

Here is my criteria class, pretty basic, just this and then a couple getters and setters.

public class TaskServerCriteria : Csla.CriteriaBase

   public TaskServerCriteria(Type collectionType)  : base(collectionType)

RockfordLhotka replied on Wednesday, May 31, 2006

How did you declare the overload of DataPortal_Fetch?

Also, what does the InnerException and/or BusinessException from your DataPortalException contain? That's where you'll find more interesting and useful exception details.

markmconel replied on Thursday, June 01, 2006

Thanks for pointing me in the right direction. My DataPortal_Fetch was declared  as:

private void DataPortal_Fetch(Criteria criteria)

and the inner most exception was "Invalid operation - fetch not allowed".  I changed my declaration to:

private void DataPortal_Fetch(TaskServerCriteria criteria)

Now everything works great. Thanks.

Copyright (c) Marimer LLC