strSide
"does not exist in the current context"
次のコードでは、示されているようにブレークポイントを配置すると、何を試しても nameが表示されます。の値が整数に変換されるようstrSide
に、最後の文字を含めてからその文字を削除したいと考えています。コンパイル エラーは発生しませんが、実行時エラーが発生します。rawId
rawId
の値が の場合rawId
、8429R
ストリッピングは機能しますが、 R
strSide に割り当てられた を取得できません。
foreach (string fieldName in Request.QueryString)
{
rawId = fieldName;
String strSide = Convert.ToString(rawId[rawId.Length - 1]); <-- name does not exist
if (!IsNumeric(rawId)) <--break point set here.
{
rawId = StripRightChar(rawId);
}
Qty = Request.QueryString[fieldName];
int productId = 0;
if (fieldName == "txtReference")
{
strComments = Request.QueryString[fieldName];
}