I have a stored procedure, which has a parameter like @CurrentDate datetime, when I pass the value DateTime.Now from the front end (C#) to this stored procedure it is working fine.
But when I change the Date Format as English(India) in my system/server, that time DateTime.Now will return a value like 25-10-2012 PM 05:23:27. I am passing this value to stored procedure and I'm getting an error message like the following,
Msg 242, Level 16, State 3, Line 10
The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.
Note : I don't want to use GETDATE() from Sqlserver, I want to pass the parameter from c#.
How can I solve this?