ThatRendle / Simple.Data

A light-weight, dynamic data access component for C# 4.0
MIT License
1.33k stars 302 forks source link

simple.data error running a stored proc after deployment to server #356

Open GusBeare opened 9 years ago

GusBeare commented 9 years ago

Hi

My app works fine in localhost but when deployed to the web server I am getting this error:

Nancy.RequestExecutionException: Oh noes! ---> System.InvalidOperationException: Operation is not valid due to the current state of the object. at Simple.Data.ObjectReference.TryInvoke(InvokeBinder binder, Object[] args, Object& result) at CallSite.Target(Closure , CallSite , Object , String , Boolean ) at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) at CallSite.Target(Closure , CallSite , Object , String , Boolean ) at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) at BeareAccounts.AccountsDataBase.GetSumExpenses(Boolean isAdmin, String taxYearEnd) at BeareAccounts.Modules.Accounts.AccountsModule.<.ctor>b_9(Object ) at CallSite.Target(Closure , CallSite , Func`2 , Object ) at Nancy.Routing.Route.<>cDisplayClass4.b3(Object parameters, CancellationToken context) --- End of inner exception stack trace --- at Nancy.NancyEngine.InvokeOnErrorHook(NancyContext context, ErrorPipeline pipeline, Exception ex)

I believe it's caused by this code:

var a = AccountsDataBase.GetSumExpenses(isAdmin, currentFinancialYearEnd);

GetSumExpenses is a stored proc. This runs fine on the server so it must be an issue with Simple.Data.

Any ideas?

thanks Gus