-1
エラーはstrProductId = row0.Cells[1].Text;
です。表示されます:aspx.net指定された引数が有効な値の範囲外です
指定された引数が有効な値の範囲外です。
誰かがコードの何が間違っていると説明できますか?ありがとうございました。
//retrieve the product ID from the first row of the DetailsView
DetailsViewRow row0 = DetailsView2.Rows[0];
strProductId = row0.Cells[1].Text;
//extract the QuantityOnHand from the database - based on the product ID
strSQLSelect = "SELECT pQty FROM Products WHERE pItemID = @ProductId";
cmd = new OleDbCommand(strSQLSelect, mDB);
cmd.Parameters.Add("@ProductId", OleDbType.VarChar).Value = strProductId;
object oQty = cmd.ExecuteScalar();
intQuantityOnHand = (int)oQty
ROW0を使用すると、デバッガ –
にしてくださいセルを確認しなかった、細胞[1]の要素を持っていません。 – Filburt
私は細胞をチェックして、それは正常に見えます。 – Kevin123