Base solution for your next web application
Open Closed

Import Users from Excel Throws Null Exception #9834


User avatar
0
BigCDogCrew created

AspNetZero 7.2 MVC / jQuery.

I seriously hope I'm not doing something stupid-easy and wasting your time with this one, but I just don't see it.

When attempting to import users from an excel spreadsheet, the individual user records are rejected with a "Nullable object must have a value" error. Then, the try-catch builds the list of these invalid users and when attempting to publish the notification fails again with the same error.

Here are the records in the import file. <br> | UserName* | Name* | Last Name* | EmailAddress* | PhoneNumber | Password* | AssignedRoleNames (comma separated) | | --------- | ----- | ---------- | ------------- | ----------- | --------- | ----------------------------------- | | Mickey | Mickey | Mouse | [email protected] | 2342342345 | 123qwe | User | | Minnie | Minnie | Mouse | [email protected] | 2342342346 | 123qwe | Admin | | Donald | Donald | Duck | [email protected] | 2342342347 | 123qwe | User | | Daisy | Daisy | Duck | [email protected] | 2342342348 | 123qwe | Admin | | Scrooge | Scrooge | McDuck | [email protected] | 2342342349 | 123qwe | Admin | <br> Here are the two images of the locations where the errors are occurring.


3 Answer(s)
  • User Avatar
    0
    zony created
    Support Team

    Hi BigCDogCrew, Can you share imported Excel files? I need this file for testing, thanks.

  • User Avatar
    0
    BigCDogCrew created

    Files have been sent via email.

  • User Avatar
    0
    zony created
    Support Team

    Hi BigCDogCrew, I used the Excel file you provided to import and it worked. Have you changed the import related code, if possible, can you share a simple Demo project?