How to handle A DateTime Linq to SQL error.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Fuzz13
    New Member
    • Jun 2010
    • 110

    #1

    How to handle A DateTime Linq to SQL error.

    Using Linq to SQL I have added a table to my project that will store data for Name, Phone, Email, and Birthday. If the date entered falls outside of 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM it spits out an error but I can't seem to figure out how to use a try catch on it. I'm not sure what exception this technically is.
  • Fuzz13
    New Member
    • Jun 2010
    • 110

    #2
    Turns out it was in fact listed as what type of error in the unhandled exception, I just didn't understand it required more then "SQLTypeExcepti on". Caught the error with this:
    Code:
    catch (System.Data.SqlTypes.SqlTypeException)

    Comment

    Working...