sql datetime overflow error

Been programming a sql datbase routine, using c# and stored procedures.

Was working fine when tested earlier -- but now, when running online I am getting the error message as indicated.

Why would this be so?

Thank you in advance for your time and efforts with this enquiry.
amillyardAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Aneesh RetnakaranDatabase AdministratorCommented:
Seems like your db contains records out of range sql can handle
0
amillyardAuthor Commented:
aneeshattingal:  does this include 'null's ?
0
amillyardAuthor Commented:
aneeshattingal: does this type of error happening when reading or writing data to db or both?
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

amillyardAuthor Commented:
I am catching this error via the exception error (and using a breakpoint) -- then hover over the ex value -- hence how I got to know this is a sqldate issue.

but...there is no reference (or easily visible) at which point this fails -- there are alot of date time entries within the database table and alot of differnet reading and writing going on.

so to get a feel where the error is actually occuring would be really useful as I only get this 1 error at the exception stage -- how can I search more intelligently for the error etc?
0
Aneesh RetnakaranDatabase AdministratorCommented:
aneeshattingal:  does this include 'null's ?

No, this throws error when the date is before 1753

does this type of error happening when reading or writing data to db or both?
While Reading the data , agian it depends


0
JimBrandleyCommented:
In VisualStudio, from the main menu, select Debug/Exceptions. In the ensuing dialog, set it to break when all exceptions are thrown. Now it will break into the debugger as soon as the exception is thrown. All objects and variables are live, so is the call stack. You should be able to tell exactly which SQL statement was executing when the exception was thrown, and you can tell which parameters were bound to the command. That should make it possible to locate the problem.

Jim
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
amillyardAuthor Commented:
JimBrandley:  spot on !!!   wow -- that is a really useful feature....

I cannot tell you how many hours I have poured over various scripting, adding logical breakpoints etc trying to capture various errors ... disabling certain lines of code, trying to isolate exactly where the issues are.  very painstaking... wow, this hit the mark instantly -- I had 1 number incorrect so a db reference was pointing at the wrong location...a needle in a haystack normally.

thank you so much for this suggestion and advise...true gold nugget on this issue.
0
JimBrandleyCommented:
Glad that helped. MS has given us some great tools in this IDE. Unfortunately, sometimes they are not easy to discover. Good luck.

Jim
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.