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 8449223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:38:38+00:00 2026-06-10T10:38:38+00:00

I often have to call the Value property when accessing my Linq to SQL

  • 0

I often have to call the Value property when accessing my Linq to SQL objects to check for null values or I get an exception. Can someone please expain these data types (i.e. decimal?, bool?, etc…) that appear to wrap the primitive types?

  • 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-06-10T10:38:39+00:00Added an answer on June 10, 2026 at 10:38 am

    They are Generics of type Nullable<T>, and they do wrap primitive types.

    Why they invented the short form int? is Nullable seems to be down to the standard confusion between succinct and terse C based language developers struggle with.

    decimal? total = null;
    

    total.HasValue will return false, it won’t blow up with a null reference

    but total.Value.ToString(); will throw an exception, because the Value property of total is null.

    The Value and HasValue properties are read only.

    total = 10;
    

    means total.Value will return 10.0 and total.HasValue will return true.

    It’s a really nice generic, especially for database types, still don’t get the short form though…

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

Sidebar

Related Questions

I have observed a behaviour in VB.net where property setters get called more often
I have a method wrapping some external API call which often returns null .
ViewWillAppear is never called automatically I have to call them manually. ViewWillDisappear is often
Often, I will have an array holding a set of values each of which
In VB.Net you can easily get the text value of the first child element
I have a fluid template, from where I call an often used snippet (called
I often have a situation in my Java code when I need to set
I often have to deal with XML documents that contain namespaced elements, but doesn't
I have found that I often have to implement some sort of a scheduler
I quite often have rows of code like the following: UPDATE my_table SET name

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.