Open Closed

Exception: System.Data.SqlTypes.SqlNullValueException: Data is Null. This method or property cannot be called on Null values. #5111


User avatar
0
Tisham.Ahuja created
  • ABP Framework version: v7.2.2
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered (MVC): yes
  • Exception message and stack trace: System.Data.SqlTypes.SqlNullValueException: Data is Null. This method or property cannot be called on Null values.
  • Steps to reproduce the issue: 1) Run the appliction 2) Load component. 3) I get this error when await AppService.GetAsync(Id); this line of code is getting executed

Below is the complete exception:

System.Data.SqlTypes.SqlNullValueException: Data is Null. This method or property cannot be called on Null values. at Microsoft.Data.SqlClient.SqlBuffer.get_String() at lambda_method3306(Closure, QueryContext, DbDataReader, ResultContext, SplitQueryResultCoordinator) at Microsoft.EntityFrameworkCore.Query.Internal.SplitQueryingEnumerable`1.AsyncEnumerator.MoveNextAsync()

** NOTE:** We are currently manually merging code from blazor assembly (non commercial) to blazor server side solution (abp commercial license). Same code is working in old solution.


6 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    How can I reproduce this problem in a new template project?

  • User Avatar
    0
    Tisham.Ahuja created

    Can we connect over the call please?

  • User Avatar
    0
    Tisham.Ahuja created

    Hi,

    I have created an AppService in Application project using below code:

    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public class LocationAppService : CrudAppService< Location, LocationDto, int, PagedAndSortedResultRequestDto, CreateUpdateLocationDto>, ILocationAppService

    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    In blazor page I have added below code:

    @inherits AbpCrudPageBase<ILocationAppService, LocationDto, int, PagedAndSortedResultRequestDto, CreateUpdateLocationDto>

    AND

    inside OnInitializedAsync() method I am writing below inbuilt method:

    await AppService.GetAsync(LocationId); ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    **NOTE: Same code is working in non commercial web assembly solution. it stopped working when we are manually merging code to commercial server assembly solution. Do we need to make any specific changes in entity or service craetion etc. when migrtaing? **

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    If you can share a simple project to reproduce that will be great.

    liming.ma@volosoft.com

  • User Avatar
    0
    Tisham.Ahuja created

    hi

    If you can share a simple project to reproduce that will be great.

    liming.ma@volosoft.com

    It is difficult to setup a new project again. Can we connect over the call now?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    It is also difficult to find the reason via the call.

    I always need to reproduce the problem on my locally.

Made with ❤️ on ABP v9.1.0-preview. Updated on December 10, 2024, 06:38