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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T18:13:38+00:00 2026-05-12T18:13:38+00:00

Recently converted my ASP.NET project from 1.1 to 3.5. Hooray! Currently developing a form

  • 0

Recently converted my ASP.NET project from 1.1 to 3.5. Hooray! Currently developing a form which has a handful of optional fields. Normally, I’d go through in my code, adding tons of if statements, checking for empty field, and setting value to 0 if so. So, I’m wondering if it would be best to instead, declare private, nullable variables for each of these fields, then add these as parameters for my database update? Using MSSQLS 2000, already set the corresponding fields to allow nulls.

To clarify: The web form has fields for dollar amounts. The default value on the inputs is 0, but if the user deletes one of those 0’s, leaving the field empty then submits the form, an exception will be thrown at Convert.ToDecimal(MoneyField.Text) in the argument list of the method that submits all this to the database. Is there a cleaner way to do this that I’m missing?

  • 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-12T18:13:39+00:00Added an answer on May 12, 2026 at 6:13 pm

    It seems unusual that you would have that many fields that are truly nullable, but if you need to describe “no value” separately to any magic domain value of (for example) an int, then yes: Nullable<T> may help. Note that you must manually translate from null to DbNull.Value at the data-layer, as null on a SqlParameter means “don’t send this parameter”, not “send the value null” (if you see the distinction).

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

Sidebar

Related Questions

Recently, my team converted ASP.NET project from .NET 1.1 to .NET 2.0. Everything is
I've recently converted an ASP.net 2.0 Web Site Project to an ASP.net 3.5 Web
I recently converted a site from asp to CF. Unfortunately, alot of the old
I have a report, which was recently converted from SSRS2005 to SSRS2208. The report
I recently converted a subversion repo, which had been converted from cvs before that
My team has recently converted a fairly large project to ARC. The conversion went
I recently updated my VS2010 website project from .NET 3.5 to 4.0. Everything was
I recently converted a project from WPF 3.5 to WPF 4.0. Functionally, everything works,
I have a hybrid asp.net web forms / mvc application that I recently converted
I recently converted a ruby library to a gem, which seemed to break the

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.