What SqlCommand.Parameters.AddWithValue really does?
问题 What changes SqlCommand.Parameters.AddWithValue() does with the query? I expect that: It replaces every ' character by '' , If a parameter value is a string or something which must be converted to a string, it surrounds the value by ' , so for example select * from A where B = @hello will give select * from A where B = 'hello world' . If a parameter value is something "safe" like an integer, it is inserted in a query as is, without quotes, so select * from A where B = @one would give select *