1
我有這個簡單的VB.NET功能:什麼是邏輯上對這種錯誤的VB.NET代碼
Dim endval = Convert.ToInt16(googleXMLdocument...<s:currentItemCount>.Value) - 1
For counter = 0 To endval
Dim seller = googleXMLdocument...<s:name>(counter).Value
Dim containsValue = ToBeIgnored.AsEnumerable().Any(Function(r) r.Field(Of String)("Ignore") = seller)
If containsValue Then
Continue For
End If
row = GoogleResults.NewRow()
GoogleResults.Rows.Add(row)
GoogleResults.Rows(counter)("Seller") = seller 'sometimes this line throws an exception there is no row at position x
Next
在最後一行有時我得到一個異常there is no row at position x
。什麼會造成這種情況?