CSLA error on Fetch data

CSLA error on Fetch data

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

vivek posted on Thursday, May 09, 2013


When i want to fetch record from CSLA it's giving error , we are using CSLA version 1 with window 7, 

please help me.

ExceptionSource: Csla: DataPortalException: DataPortal.Fetch failed ()
ExceptionDetail: Csla.DataPortalException: DataPortal.Fetch failed () ---> System.NullReferenceException: Object reference not set to an instance of an object.
at Csla.Server.CallMethodException..ctor(String message, Exception ex) in C:\Tools\CSLA\csla20cs\Csla\DataPortal\Server\CallMethodException.cs:line 44
at Csla.MethodCaller.CallMethod(Object obj, MethodInfo info, Object[] parameters) in C:\Tools\CSLA\csla20cs\Csla\DataPortal\MethodCaller.cs:line 118
at Csla.Server.SimpleDataPortal.Fetch(Type objectType, Object criteria, DataPortalContext context) in C:\Tools\CSLA\csla20cs\Csla\DataPortal\Server\SimpleDataPortal.cs:line 109
--- End of inner exception stack trace ---
at Csla.DataPortal.Fetch(Type objectType, Object criteria) in C:\Tools\CSLA\csla20cs\Csla\DataPortal\Client\DataPortal.cs:line 192
at Csla.DataPortal.Fetch[T](Object criteria) in C:\Tools\CSLA\csla20cs\Csla\DataPortal\Client\DataPortal.cs:line 140




JonnyBee replied on Thursday, May 09, 2013


The most likely cause is that the DataPortal is unable to find a DataPortal_Fetch method that accepts the parameters that you supplied to the call. This is done dynamically using the MethodCaller. 

vivek replied on Tuesday, May 14, 2013

Hi Jonny,


Thanks for reply, but i am un able to trace why this error comes 

public static GetIdentity GetIdentity(string userName)


return Csla.DataPortal.Fetch<Project>(new Criteria(id));



Can you please suggest how we can check , from where this error comes, how we get stopped.



JonnyBee replied on Tuesday, May 14, 2013

Add the CSLA source code and trace into the csla internals.

Also take note of the actual complete stacktrace and look at the parameters and the actual definition of the method to be called. 

Copyright (c) Marimer LLC