查询有什么变化SqlCommand.Parameters.AddWithValue()
?
我希望:
'
它将每个字符替换为''
,如果参数值是字符串或必须转换为字符串的东西,它会用 包围该值
'
,例如select * from A where B = @hello
将给出select * from A where B = 'hello world'
。如果参数值是像整数这样“安全”的东西,它会按原样插入查询中,不带引号,所以
select * from A where B = @one
会给出select * from A where B = 1
.
还有其他我不知道的变化吗?