質問

どのようにシンボルを以下のとおり取り扱いのクエリの種類ごとに全て別々の?

/vendordataservice.svc/vDataMapper_SourceMapVendor?&$filter=startswith(ParentName,'AT&T')&$top=7&$skip=0

を使用していEF3.5SQL2008.私はそれを私の種類ごとに全て別々のサービスを取得しデータなします。

役に立ちましたか?

解決 2

一覧はこちらの文字をすべきで符号化され送信前にSQLサーバー上HTTP:

http://msdn.microsoft.com/en-us/library/aa226544(SQL.80).aspx

あり、'&'シンボルも例外ではありません。

他のヒント

  

「JavaScriptの文字列()メソッドを置き換える」は使用しないでください。これは、特殊文字が最初に出現を置き換えます。あなたはフィルタリングパラメータで同じ特殊文字の2出現を持っている場合、それは失敗します。だから、文字を置換するために正規表現を使用します。

function replaceSpecialCharacters(attribute) {
  // replace the single quotes
     attribute = attribute.replace(/'/g, "''");

     attribute = attribute.replace(/%/g, "%25");
     attribute = attribute.replace(/\+/g, "%2B");
     attribute = attribute.replace(/\//g, "%2F");
     attribute = attribute.replace(/\?/g, "%3F");

     attribute = attribute.replace(/#/g, "%23");
     attribute = attribute.replace(/&/g, "%26");
     return attribute;
}
代替品も含まれているため、また、自己が先頭に交換する必要があります%はそれを%、注意を払う。

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top