开发者

How to escape the parameter symbol in ADO.NET

开发者 https://www.devze.com 2023-01-20 08:40 出处:网络
We\'re using ADO.NET with parameterized queries with SQL S开发者_StackOverflow中文版erver using the DBCommand object, so the parameter symbol is @, and things have been working fine.However we now hav

We're using ADO.NET with parameterized queries with SQL S开发者_StackOverflow中文版erver using the DBCommand object, so the parameter symbol is @, and things have been working fine. However we now have a query where @ is part of the hard coded data. By default ADO.NET thinks it IS a parameter and the whole thing goes pear shaped.

Is there a way to escape the @ in this one case so it's just treated as part of the data? I tried \@ but that didn't work either.

0

精彩评论

暂无评论...
验证码 换一张
取 消