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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:18:04+00:00 2026-05-11T20:18:04+00:00

On the NerdDinner example a set of business rules are written to validate the

  • 0

On the NerdDinner example a set of business rules are written to validate the data on a model. Things like empty strings are checked for and by calling modelObject.GetRuleViolations() you can get them all. But there’s another layer of validation which is the database. For example, the datetime field is left for validation to the database, which only accepts a string that can be converted into a DateTime object.

The problem I see is that modelObject.GetRuleViolations() never return the violation for datetime. So even when it is correctly prevented from saving the record and the form is shown back specifying there’s an error and highlighting the datetime field, there’s no specific error message. Is there a way to get the database validation errors among the business rules validation errors?

  • 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-11T20:18:04+00:00Added an answer on May 11, 2026 at 8:18 pm

    You need to catch the exceptions thrown by your Data Access Layer, and convert those into calls which update the ModelState to indicate the errors in question. There’s not really a good way to do this on a global level, since specific SQL errors will only be able to be interpreted at the time they’re called, rather that handled in a generic way.

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

Sidebar

Related Questions

I have an ASP.NET MVC application that is calendar-like. As per the NerdDinner example,
If you look at the NerdDinner example of creating and editing dinners then you
I'm working through the NerdDinner ASP.NET MVC 1.0 example. I have it all working
I am working with a paginated list like in the NerdDinner sample. I am
I am looking for some guidance on how to incorporate business rules into an
On the NerdDinner example of Professional ASP.NET MVC 1.0 there's a method to create
I'm trying to go through the NerdDinner example chapter from the ASP.Net MVC 1.0
I'm slowly modernizing: Can I run the ASP MVC example NerdDinner on my XP
So I'm trying to implement OpenID using NerdDinner 2 as an example. When you
I want to show few countries marked with pin much like what the nerddinner

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.