我尝试在容器中搜索时遇到了麻烦。我的代码是:
Dim strtextbox As String = "<p>This B2C tenant must be linked to an active Azure subscription for communication, support and billing. <a href='https://docs.microsoft.com/azure/active-directory-b2c/active-directory-b2c-how-to-enable-billing' target='_blank' aria-label='Learn More - This B2C tenant must be linked to an active Azure subscription for communication, support and billing.'>Learn More</a></p>\r\n<p><b>If your Subscription status is No Subscription, please link this B2C tenant to an Azure subscription,</b></p>\r\n<p>\r\n <ol>\r\n <li><a href='#menu/account'>Switch Directories</a> to the location of your target Azure subscription</li>\r\n <li>Under Marketplace, search for and select 'B2C'</li>\r\n <li>Select Create to link this B2C Tenant to a subscription</li>\r\n </ol>\r\n</p>\r\n<p><b>If your Subscription status is Warned, Suspended or Deleted, navigate to the linked Subscription for more information,</b></p>\r\n<p>\r\n <ol>\r\n <li><a href='#menu/account'>Switch Directories</a> to the location of the Azure subscription linked to this B2C Tenant</li>\r\n <li>Under All Resources click on your B2C Tenant resource</li>\r\n <li>Under Essentials select your subscription and review Subscription status</li>\r\n </ol>\r\n</p>"
Dim res = cont.Entity.Where(Function(b) String.Compare(b.FullSourceString, strtextbox, True) = 0)
For Each j As Entity in res
do something
End For
嗯,问题在于该字符串和其他html大字符串。 odata.client&#34;处理此请求时发生错误&#34;抛出一个例外。如果我从字符串修改2或3个东西,这是有效的。 uri可以正常使用这些字符串。我认为问题在于OData协议。
一些帮助?
提前致谢
答案 0 :(得分:0)
我相信你需要通过将它们加倍来逃避任何单引号。
strtextbox = strtextbox.Replace("'", "''")