RowCollectionが50000以上の場合、次の関数からメモリ不足の例外が発生するため、メモリ効率を高める必要があります。この関数は、RowCollectionに格納されている行インデックスのコンマ区切りの文字列を作成するだけです。誰かが次のような明らかなメモリを必要とする操作を見つけることができますか?
NB RowCollectionには、整数として格納されている行インデックスのリストが含まれているだけです。
Private Function GetCommaSeparatedString(ByRef RowIndexes As ArrayList) As String
Dim RowString As String = String.Empty
'Build a string of the row indexes
'Add one onto each index value so our indexes begin at 1
For Each Row In RowIndexes
RowString += CInt(Row.ToString) + 1 & ","
Next
'Remove the last comma
If RowString.Length > 0 Then
RowString = RowString.Substring(0, RowString.Length - 1)
End If
Return RowString
End Function
前もって感謝します。