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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T14:23:42+00:00 2026-05-10T14:23:42+00:00

We have our own ORM we use here, and provide strongly typed wrappers for

  • 0

We have our own ORM we use here, and provide strongly typed wrappers for all of our db tables. We also allow weakly typed ad-hoc SQL to be executed, but these queries still go through the same class for getting values out of a data reader.

In tweaking that class to work with Oracle, we’ve come across an interesting question. Is it better to use DBNull.Value, or null? Are there any benefits to using DBNull.Value? It seems more ‘correct’ to use null, since we’ve separated ourselves from the DB world, but there are implications (you can’t just blindly ToString() when a value is null for example) so its definitely something we need to make a conscious decision about.

  • 1 1 Answer
  • 1 View
  • 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. 2026-05-10T14:23:43+00:00Added an answer on May 10, 2026 at 2:23 pm

    I find it better to use null, instead of DB null.

    The reason is because, as you said, you’re separating yourself from the DB world.

    It is generally good practice to check reference types to ensure they aren’t null anyway. You’re going to be checking for null for things other than DB data, and I find it is best to keep consistency across the system, and use null, not DBNull.

    In the long run, architecturally I find it to be the better solution.

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

Sidebar

Related Questions

If we have developed our own ORM framework and the framework is working fine
I have 4 tables which holds information about our Licenses. We have our own
I know we all have our own personal hell stories of setting up iOS
We have our own custom calendar in our portal which is developed in Java.
We have our own media player built in Javascript and I was wondering if
We have our own data streaming algorithm that include some metadata+records+fields values. Currently we
We have an app for OS X which we distribute via our own website,
I have a scenario where I am to send email using our own SMTP
I have a Dictionary<Guid, ElementViewModel> . (ElementViewModel is our own complex type.) I add
Our inHouse tech have installed our own app to some of our iPods 3.x

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.