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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:12:14+00:00 2026-05-28T03:12:14+00:00

I am looking for some suggestion over best practice (considering Memory and CPU time)

  • 0

I am looking for some suggestion over best practice (considering Memory and CPU time) to handle Nullable<T> fields returned from a stored procedure on using Linq2Sql.

Please consider the following scenario and limitations:

  1. I want to avoid using fieldValue.HasValue check everywhere in the code. Thus, I need to replace all Nullable<T> with normal properties (esp DateTime, Double, Int) with some default value.
  2. I am expecting to read ~1million objects with ~20 fields of Nullable type.
  3. Memory and CPU usage is an important consideration.
  4. The requirement is to get result from stored proc in an object (not DataRow), and thus using Linq2Sql.

Please share your opinion or experience over handling a similar situation.

Thanks for your interest.

  • 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-28T03:12:15+00:00Added an answer on May 28, 2026 at 3:12 am

    Best Solution:

    • Don’t allow SQL to return NULL Values.

    • The easiest way to do this is to not allow the columns themselves to be null, but if that isn’t a possibility then you can do an ISNULL(field, defaultvalue) in the query that you are using to return the data.

    Next Best Solution:

    • Overwrite the LINQToSQL objects get call to check if the object HasValue and then if not set it to the default(type) value for the field.

    There is no way to not check every value.

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

Sidebar

Related Questions

Looking for some advice on the best way to implement localization along with client
Looking for some resources on SOA / BPEL best practices. Specially BPEL.
I'm looking for the best practice way to achieve a message / notification system.
I am trying to come over to java from C++ and am having some
I am looking for suggestions on the best way to send/receive data from a
I'm looking for some suggestions on how to go about this. Any input is
I'm looking for some suggestions as to how I could implement a World Map
Looking through some code I came across the following code trTuDocPackTypdBd.update(TrTuDocPackTypeDto.class.cast(packDto)); and I'd like
Looking for some direction here as I'm running into some migration problems. We have
Looking for some help with a Labview data collection program. If I could collect

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.