html
  • vb.net
  • linq
  • api
  • odata
  • 2017-06-29 5 views 0 likes 
    0

    コンテナで検索しようとすると問題が発生します。私のコードはそれです:特定の文字列を持つOデータ例外

    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 "このリクエストを処理中にエラーが発生しました"は例外をスローします。私は文字列から2つまたは3つのものを変更する場合、これは動作します。 uriはその文字列でうまく動作します。私が思う問題は、ODataプロトコルです。

    いくつかお手伝いしますか?事前に

    おかげで

    答えて

    0

    私はあなたがそれらを倍増することにより、任意の単一引用符をエスケープする必要があると考えています。

    strtextbox = strtextbox.Replace("'", "''") 
    
    関連する問題