• 0
Votes
name

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191

Backtrace:

File: /var/www/html/cnasolution/application/views/question.php
Line: 191
Function: _error_handler

File: /var/www/html/cnasolution/application/controllers/Questions.php
Line: 419
Function: view

File: /var/www/html/cnasolution/index.php
Line: 315
Function: require_once

name Punditsdkoslkdosdkoskdo

Entityframework format exception on query

i got the following query

        private const String _RFS_TAG = "NEW_RFS_WLI";         private const String _RFS_QUERY_FILTER = "'{"bsareadyforservicewli" : {"messageheader" : {"messagetype" : "" + _RFS_TAG + ""}}}'";          private const String _LATEST_RFS_FOR_ENTRY_POINT_QUERY = "SELECT o.* FROM connectivity_order_entry_points as oep " +                             "INNER JOIN connectivity_orders as o " +                             "ON oep.connectivity_order_id = o.id " +                             "INNER JOIN connectivity_order_updates as ou " +                             "ON o.id = ou.connectivity_order_id " +                             "WHERE oep.connectivity_entry_point_id = {0} AND " +                             "ou.data @> " + _RFS_QUERY_FILTER + " " +                             "ORDER BY ou.id DESC " +                             "LIMIT 1;"; 

When i execute the following method trying to execute the sql statement

        public async override Task GetActiveOrderForEntryPoint(int id)         {             return await Context.Orders.FromSql(_LATEST_RFS_FOR_ENTRY_POINT_QUERY, id).FirstOrDefaultAsync();         } 

I get an exception saying Input string was not in correct format.. The backend is a PostgreSQL database (verison 10). But i can't figure out where exactly is going wrong.

The full stacktrace

fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1]       An unhandled exception has occurred while executing the request. System.FormatException: Input string was not in a correct format.    at System.Text.StringBuilder.FormatError()    at System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args)    at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)    at System.String.Format(String format, Object[] args)    at Microsoft.EntityFrameworkCore.Query.Sql.DefaultQuerySqlGenerator.GenerateFromSql(String sql, Expression arguments, IReadOnlyDictionary`2 parameters)    at Microsoft.EntityFrameworkCore.Query.Sql.DefaultQuerySqlGenerator.VisitFromSql(FromSqlExpression fromSqlExpression)    at Microsoft.EntityFrameworkCore.Query.Sql.DefaultQuerySqlGenerator.b__59_0(Expression e)    at Microsoft.EntityFrameworkCore.Query.Sql.DefaultQuerySqlGenerator.GenerateList[T](IReadOnlyList`1 items, Action`1 generationAction, Action`1 joinAction, IReadOnlyList`1 typeMappings)    at Microsoft.EntityFrameworkCore.Query.Sql.DefaultQuerySqlGenerator.GenerateList(IReadOnlyList`1 items, Action`1 joinAction, IReadOnlyList`1 typeMappings)    at Microsoft.EntityFrameworkCore.Query.Sql.DefaultQuerySqlGenerator.VisitSelect(SelectExpression selectExpression)    at Microsoft.EntityFrameworkCore.Query.Sql.DefaultQuerySqlGenerator.GenerateSql(IReadOnlyDictionary`2 parameterValues)    at Microsoft.EntityFrameworkCore.Query.Internal.ShaperCommandContext.GetRelationalCommand(IReadOnlyDictionary`2 parameters)    at  
Download script demo [LINK]
Download script demo [LINK 2] Download script demo [LINK 2]