How does one convert a C# Datetime into the equivalent SQL DATE type, so that I can do a simple equality in a WHERE clase, with no parametisation?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Simply convert it to a iso string.
Date and Time
Only Date
But i really encourage you to use parameterized queries because you will generate a new Sql Execution plan everytime your T-SQL query is different.
If you use Parameters you will get only one plan. This results in better performance.
More Information