asp.net - Why Windows Server 2003 causes "varchar to datetime out-of-range", wheras Server 2008 does not -


i have written small asp.net application using entity framework.

a stored procedure accepts following: employeeid int, startdate varchar(12),enddate varchar(12)

i use sql server convert short date strings datetime.

set @correctstartdate = convert(datetime,(convert(varchar(10),@startdate,103) + ' 00:00:00am'), 103) set @correctenddate = convert(datetime,(convert(varchar(10),@enddate,103) + ' 11:59:59pm'), 103) 

in development environment iis7 windows server 2008 sql server 2008 r2 there no issues.

if deploy production server iis6 (windows server 2003 sp2 sql server 2008 r2) get:

"the conversion of varchar data type datetime data type resulted in out-of-range value.the conversion of varchar data type datetime data type resulted in out-of-range value."

why be? both have regional settings same.

what values of start , end date?

try doing same using datetime2 instead of datetime.


Comments

Popular posts from this blog

Javascript line number mapping -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -