I was wondering what is the best way to parse a DateTime object to your SQL server.
Where you are generating the SQL in code.
I have always used something like DateTime.Now.TolongDateString()
and had good results, apart from today where i got a error, and it made me think.
System.Data.SqlClient.SqlException: Conversion failed when converting datetime from character string
So what is everyone thoughts and recomendations for a way that will work acrss all SQL server no matter what there setup..
Maybe something like DateTime.Now.ToString("yyyy/MM/dd")