Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception thrown when querying SP with multiple record sets #22

Open
eugenevital opened this issue Oct 19, 2016 · 0 comments
Open

Exception thrown when querying SP with multiple record sets #22

eugenevital opened this issue Oct 19, 2016 · 0 comments

Comments

@eugenevital
Copy link

We are receiving the following exception when I execute an MS Sql (2012) SP that returns multiple result sets. I modified the DatabaseDemo.cs for testing purposed to call this SP.

here is the relevant code with exception.

StoredProcParam[] parameters = new[]
{
new StoredProcParam
{
Name = "pBeginDT",
ParamType = "IN",
Length = 8,
Value = "20161001",
Type = "datetime"
},
new StoredProcParam
{
Name = "pEndDT",
ParamType = "IN",
Length = 8,
Value = "20161019",
Type = "datetime"
}

            };

        var result = await databaseApi.CallStoredProcAsync<ExpandoObject>("GetDailyEnrollmentStats", parameters)

System.AggregateException was unhandled
HResult=-2146233088
Message=One or more errors occurred.
Source=mscorlib
StackTrace:
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait()
at DreamFactory.Demo.Program.<>c__DisplayClass5_0.

b__0(IRunnable test) in C:\code\evital.net-sdk\DreamFactory.Demo\Program.cs:line 53
at System.Array.ForEach[T](T[] array, Action1 action) at DreamFactory.Demo.Program.Main() in C:\code\evital.net-sdk\DreamFactory.Demo\Program.cs:line 49 at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() InnerException: HResult=-2147467262 Message=Unable to cast object of type 'System.Collections.Generic.List1[System.Object]' to type 'System.Dynamic.ExpandoObject'.
Source=Newtonsoft.Json
StackTrace:
at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
at DreamFactory.Serialization.JsonContentSerializer.Deserialize[TObject](String content) in C:\code\evital.net-sdk\DreamFactory\Serialization\JsonContentSerializer.cs:line 49
at DreamFactory.Api.Implementation.DatabaseApi.d__221.MoveNext() in C:\code\evital.net-sdk\DreamFactory\Api\Implementation\DatabaseApi.Stored.cs:line 143 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult()
at DreamFactory.Demo.Demo.DatabaseDemo.d__2.MoveNext() in C:\code\evital.net-sdk\DreamFactory.Demo\Demo\DatabaseDemo.cs:line 102
InnerException:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant