i am trying to insert a record. one field is described as smalldatetime on a table in ms sql server 2008. I am using the prepared statement to insert the record. for example, if i am getting the data from a textfield on a panel, my code is like this:
I am getting "conversion from datetime data type to smalldatetime data type resulted in a smalldatetime overflow error". I am using jtds driver.
Smalldatetime can't store as much data as datetime, hence the error. smalldatetime is SQL Server specific data type so if you want to use it you'll need to use the driver-specific classes to support it. jTDS has a DateTime class to do conversions.