D
Dave
Hi,
Whats the best way of handling dates gathered from the OS (e.g. using
DateTime.Now or SqlDateTime) and using it in a SQL query? I want to create
a culture neutral string so that a SQL server will process the date no
matter of the language or database settings.
Overloading DateTime.ToString with "s" seems to produce a date that SQL
processes regardless of the original date format or OS settings, but there
is no equivalant overload with SqlDateTime.
How do most people handle this and avoid the error "Syntax error converting
datetime from character string"?
Thanks.
Whats the best way of handling dates gathered from the OS (e.g. using
DateTime.Now or SqlDateTime) and using it in a SQL query? I want to create
a culture neutral string so that a SQL server will process the date no
matter of the language or database settings.
Overloading DateTime.ToString with "s" seems to produce a date that SQL
processes regardless of the original date format or OS settings, but there
is no equivalant overload with SqlDateTime.
How do most people handle this and avoid the error "Syntax error converting
datetime from character string"?
Thanks.