字符串转义

例如 “MaterialCode = 'Waston's001' and MediaTypeId =5”

红色部分需要转义,在sql中 应写成  where code = 'Waston''s001';

c#中'Waston\''s001'  code = code.Replace("'","\''");

posted @ 2012-05-08 16:21  keiwa  阅读(129)  评论(0)    收藏  举报