Open Closed

SqlException: Cannot insert the value... (#430) #435


User avatar
0
tngo created

Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/
Check the samples, to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index
The exact solution to your question may have been answered before, please use the search on the homepage.

  • ABP Framework version: vX.X.X

  • UI type: Angular / MVC

  • Tiered (MVC) or Identity Server Seperated (Angular): yes / no

  • Exception message and stack trace:

  • Steps to reproduce the issue:


2 Answer(s)
  • User Avatar
    0
    tngo created

    It happened in DbMigrator when created AbpUser tabble. The trouble field is CountryId, defined in AbpUser:
    [CountryId] UNIQUEIDENTIFIER DEFAULT ('00000000-0000-0000-0000-000000000000') Not NULL,

    I thought that when first created table AbpUser, the table will create/fill CountryId with '00000000-0000-0000-0000-000000000000' as defined because this field can't be null. But the error indicated that the CountryId can't be null. I attempted to insert NULL in the field so
    I got the SQL Exception Error by Program.cs of DbMigrator when calling await CreateHostBuilder(args).RunConsoleAsync();

    Thank you,
    Trang

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi tngo

    Can you explain it in detail?

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