strSide "does not exist in the current context"次のコードでは、示されているようにブレークポイントを配置すると、何を試しても nameが表示されます。の値が整数に変換されるようstrSideに、最後の文字を含めてからその文字を削除したいと考えています。コンパイル エラーは発生しませんが、実行時エラーが発生します。rawIdrawId
の値が の場合rawId、8429Rストリッピングは機能しますが、 RstrSide に割り当てられた を取得できません。
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];
}