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

Insert into a triggered view returns dbnull #159

Open
PTCMAR2 opened this issue Jul 8, 2020 · 1 comment
Open

Insert into a triggered view returns dbnull #159

PTCMAR2 opened this issue Jul 8, 2020 · 1 comment

Comments

@PTCMAR2
Copy link

PTCMAR2 commented Jul 8, 2020

I am using UIOMatic to insert into a View with a trigger instead of insert. The record is inserted but I receive an error: "Object cannot be cast from DBNull to other types".

And the following details:

Exception Details System.InvalidCastException: Object cannot be cast from DBNull to other types. Stacktrace at System.DBNull.System.IConvertible.ToInt64(IFormatProvider provider) at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider) at System.Convert.ChangeType(Object value, Type conversionType) at Umbraco.Core.Persistence.Database.PocoColumn.ChangeType(Object val) at Umbraco.Core.Persistence.Database.Insert(String tableName, String primaryKeyName, Boolean autoIncrement, Object poco) at UIOMatic.Data.DefaultUIOMaticRepository.Create(Object entity) at UIOMatic.Services.PetaPocoObjectService.Create(Type type, IDictionary2 values)
at UIOMatic.Web.Controllers.ObjectController.Create(ObjectPostModel model)
at lambda_method(Closure , Object , Object[] )
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.b__9(Object instance, Object[] methodParameters)
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary2 arguments, CancellationToken cancellationToken) --- 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.Web.Http.Controllers.ApiControllerActionInvoker.

@TimGeyssens
Copy link
Owner

hey, do you have some more details? Like the view trigger, the poco? Errors seems to be Umbraco Core related (coming from Umbraco.Core.Persistence.Database.PocoColumn.ChangeType)

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

No branches or pull requests

2 participants