<note to self>
I have run into this problem a few times, but for some reason can never seem to remember the resolution. Therefore I decided to note it here for future reference.
When trying to insert a null value for a nullable datetime field in sql 2K, I end up getting the SqlDateTime Overflow error. This appears to be a problem with a difference between the definition of the Date and Datetime datatypes in .net and sql2K.
The way I found to solve this (there may be better and I would love to hear if there are) is:
if myDate = DateTime.MinValue then
myParamater.Value = System.DBNull.Value
else
myParamater.Value = myDate
end if
Please weigh in if you have any additional insight or a better solution, but this does seem to work.
</note to self>
Eric Wise posts a great article on
firing your clients. I really love his take on this. I could have used his advice before venturing down the road of full time consultant myself. I have had nearly every one of these clients and have made all the mistakes that enable them to be the way they are. Thanks Eric for this insightful article.