Frans,
I'm looking at 5.7.1 hotfix and I am getting this exception (JSON formatted below). It looks like an index (sourceColumnIndex) is being incremented before it is used to access the DataRowCollection so its value is always +1 of what it should be?
top of while loop, so dsIndex is always sourceColumnIndex + 1
int sourceColumnIndex = dsIndex;
dsIndex++;
if this condition is met, sourceColumnIndex is assigned dsIndex (which increments it by 1)
// check if the column is mapped through a mapping and the name is different/renamed in the typedview
// this is ok as the only situation where this can work is when columns are added to the resultset that aren't mapped.
// so fpiIndex is an ok index to read the sourcecolumn for.
if(fieldsPersistenceInfo[fpiIndex]?.SourceColumnName == resultsetColumnName)
{
// same, so use the column name at the fpiIndex in the datatable passed in.
sourceColumnIndex = dsIndex;
}
sourceColumnIndex is +1 of what it should be which eventually throws IndexOutOfRangeException
Type typeOfColumn = (Type)schemaTable.Rows[sourceColumnIndex]["DataType"];
Exception:
{
"Message":"An error has occurred.",
"ExceptionMessage":"There is no row at position 19.",
"ExceptionType":"System.IndexOutOfRangeException",
"StackTrace":" at System.Data.RBTree`1.GetNodeByIndex(Int32 userIndex)\r\n at System.Data.DataRowCollection.get_Item(Int32 index)\r\n at SD.LLBLGen.Pro.ORMSupportClasses.DataTableFiller.Fill(IDataReader dataSource, DataTable toFill, IFieldPersistenceInfo[] fieldsPersistenceInfo, IRetrievalQuery queryExecuted) in C:\\junk\\llblgen_v5.7.1\\Frameworks\\LLBLGen Pro\\RuntimeLibraries\\ORMSupportClasses\\Miscellaneous\\DataTableFiller.cs:line 141\r\n at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterCore.ExecuteMultiRowDataTableRetrievalQuery(IRetrievalQuery queryToExecute, DbDataAdapter dataAdapterToUse, DataTable tableToFill, IFieldPersistenceInfo[] fieldsPersistenceInfo) in C:\\junk\\llblgen_v5.7.1\\Frameworks\\LLBLGen Pro\\RuntimeLibraries\\ORMSupportClasses\\AdapterSpecific\\DataAccessAdapterCore.cs:line 858\r\n at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterCore.FetchTypedView(ITypedView2 typedViewToFill, IRetrievalQuery queryToUse) in C:\\junk\\llblgen_v5.7.1\\Frameworks\\LLBLGen Pro\\RuntimeLibraries\\ORMSupportClasses\\AdapterSpecific\\DataAccessAdapterCore.cs:line 2972\r\n at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.<>n__15(ITypedView2 typedViewToFill, IRetrievalQuery queryToUse)\r\n at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.<>c__DisplayClass16_0.<FetchTypedView>b__0() in C:\\junk\\llblgen_v5.7.1\\Frameworks\\LLBLGen Pro\\RuntimeLibraries\\ORMSupportClasses\\AdapterSpecific\\DataAccessAdapterBase.cs:line 350\r\n at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.ExecuteWithActiveRecoveryStrategy(Action toExecute) in C:\\junk\\llblgen_v5.7.1\\Frameworks\\LLBLGen Pro\\RuntimeLibraries\\ORMSupportClasses\\AdapterSpecific\\DataAccessAdapterBase.cs:line 892\r\n at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.FetchTypedView(ITypedView2 typedViewToFill, IRetrievalQuery queryToUse) in C:\\junk\\llblgen_v5.7.1\\Frameworks\\LLBLGen Pro\\RuntimeLibraries\\ORMSupportClasses\\AdapterSpecific\\DataAccessAdapterBase.cs:line 350\r\n at hikurangi.Api.UnapprovedLeadsController.GetAllUnapprovedLeads() in C:\\E\\hikurangi\\Api\\UnapprovedLeadsController.cs:line 37\r\n at lambda_method(Closure , Object , Object[] )\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass6_2.<GetExecutor>b__2(Object instance, Object[] methodParameters)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__3.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n at hikurangi.Api.AddChallengeOnUnauthorizedResult.<ExecuteAsync>d__9.MoveNext() in C:\\E\\hikurangi\\Api\\IdentityBasicAuthenticationAttribute.cs:line 143\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.AuthenticationFilterResult.<ExecuteAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__15.MoveNext()"
}
Thank you for your help with this