I have a date time span but currently a user can type in 12:00:00:00 and I get this error:
SqlDbType.Time overflow. Value ’12:00:00:00′ is out of range. Must be between 00:00:00.0000000 and 23:59:59.9999999.
So to stop them doing this I thought it would be easier if I strip all characters after the third colon. How do I do this?
You want
12:00:00.00not12.00:00:00Note fullstop in yours.
Try
Also check out SqlDbType.Time and TimeSpan incompatibility