I\'ve been using cmd.Parameters.AddWithValue, and not specifying a DBType (int, varchar,...) to run queries. After looking at SQL Profiler, it seems that queries run with t
What is the SQL statement generated in both the cases?
I am suspecting that it assumes the value as varchar when you don't explicitly specify it.
e.g. SELECT OrderId FROM Orders WHERE OrderId = 1001 vs SELECT OrderId FROM Orders WHERE OrderId = '1001'
SELECT OrderId FROM Orders WHERE OrderId = 1001
SELECT OrderId FROM Orders WHERE OrderId = '1001'