Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6361645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:48:17+00:00 2026-05-24T23:48:17+00:00

My program keeps throwing an InvalidOperationException with the error The null value cannot be

  • 0

My program keeps throwing an InvalidOperationException with the error “The null value cannot be assigned to a member with type System.Boolean which is a non-nullable value type”. I can’t make any sense of this because my code isn’t trying to assign anything, simply iterate through a list and generate string of all claim numbers (or return an empty string if the enquiry has no associated claims):

public string ClaimNumbers
{
    get
    {
        if (Enquiry.Claims != null && Enquiry.Claims.Count>0)
        {
            var sb = new StringBuilder();
            foreach (var claim in Enquiry.Claims)
            {
                sb.Append(claim.ClaimId.ToString("00000") + ", ");
            }
            return sb.ToString().Substring(0, sb.Length - 2);
        }
        return string.Empty;
    }
}

The odd thing is that when I step through the code in the debugger and try to expand Enquiry.Claims.Count, I see:

enter image description here

But then when I pause a bit and step onto the next line it changes to:

enter image description here

I am using Linq to Sql, and Claims is an entity set, so I wondered if perhaps it was something to do with pulling the data from the database, however I’m not sure, so can’t think what the best way to tackle fixing it is.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T23:48:17+00:00Added an answer on May 24, 2026 at 11:48 pm

    I assume that the CLAIMS table has a column that is mapped to a boolean property in your Claims entity and that column contains at least one NULL value.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My twisted python program keeps spewing this message ever so often: Unhandled error in
I've currently got a spreadsheet type program that keeps its data in an ArrayList
Well, my program keeps giveing me a null point exception and I don't know
A program receives a list of Messages (base type). Each message in the list
User submits a CSV file which is consumed by a program. Values which are
My AJAX search program keeps asking PHP for results of a particular search term.
The following program keeps crashing and I can't figure out what's wrong. It seems
My code is pasted below.When I run this program,it keeps on calculating.I am using
The Program keeps crashing when i try to run it on my handset. cant
Hey Guys, I am writing a performance monitor program that keeps track of different

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.