-1
enter image description here當我運行此代碼並且所有響應均可以,但如果在我的課程中添加了更多響應,則會顯示錯誤,並且我被卡住。請幫助我。我會感謝你。超出範圍指數超出範圍。必須是非負的,並且小於集合的大小。參數名稱:i
else if(auths.Count != payable.Length)
{
for (int i = 0; i < payable.Length; i++)
{
var item = new PayableTransfers
{
URN = payable[i].uniqueReferenceNumber,
OperationDate = payable[i].operationDate,
TransactionCode = payable[i].transactionCode,
IsBlocked = payable[i].isBlocked,
PaymentMode = payable[i].paymentMode,
DestinationCode = payable[i].destinationCode,
DestinationAddress = payable[i].destinationAddress,
IsIncident = payable[i].isIncident,
IsRequestedForCancelation = payable[i].isRequestedForCancelation
};
var set = payable[i].uniqueReferenceNumber;
var setss = sets[i];
if (setss == set)
{
repositorylist.Update(item);
}
else
{
repositorylist.Add(item);
}
}
}
其中線,很可能您的收藏沒有指定索引? – Sajeetharan
var setss = sets [i]; 第9個數字從底部 –
是它有9個元素從數據庫中提取和設置(響應)有13個元素 –