当RowCollection是50000+,因此我需要使内存更有效。该函数只需构造RowCollection中存储的行索引的逗号分隔字符串即可。任何人都可以在下面找到任何明显的内存饥饿操作?VB.net需要内存高效功能
N.B 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
在此先感谢。
正确的拼写是“分离”的。 – 2010-08-31 16:07:32
在附注中,为什么'ArrayList'?这看起来像'List'的工作。 –
2010-08-31 19:26:39