List(Of T) 中的 StackOverflow
我有一个在 ASP.NET (VB.NET) 中使用 Lucene.net 的程序,当您搜索一个术语时,结果存储在 Lucene.net 数据结构“hits”中。
我想将命中读入数据结构并使用它们,然后将它们显示在 DataGrid 中。
通过搜索具有大量结果的术语,经常(但并非总是)出现以下代码错误:
For i = 0 To results - 1 Step 1
Try
Dim tmpobj As New object_hit(( _
hits.Doc(i).Get("title") + _
hits.Doc(i).Get("doc_typ")), _
hits.Doc(i).Get("pfad"), _
hits.Doc(i).Get("last_change"), _
hits.Doc(i).Get("doc_typ"), _
CStr(hits.Score(i)))
list_of_results.Add(tmpobj) 'works'
Catch
meldung.Text = "Stackoverflow- zuviele Ergebnisse "
myexception = True
End Try
我检查了服务器;它是一个 dwh 服务器,执行程序没有问题。
起初我使用 ReDim Array
,但现在我使用 List(Of T)
。我听说这应该可以解决问题,但事实并非如此 - 现在我很困惑,不知道该怎么办 - 有人可以帮我吗?
I have a program that uses Lucene.net in ASP.NET (VB.NET), when you search a term, results are stored in the Lucene.net data structure "hits".
I want to read out the hits into an data structure and work with them, after that I display them in a DataGrid
.
By searching a term with a lot of results, often (but not always) there is an error by following code :
For i = 0 To results - 1 Step 1
Try
Dim tmpobj As New object_hit(( _
hits.Doc(i).Get("title") + _
hits.Doc(i).Get("doc_typ")), _
hits.Doc(i).Get("pfad"), _
hits.Doc(i).Get("last_change"), _
hits.Doc(i).Get("doc_typ"), _
CStr(hits.Score(i)))
list_of_results.Add(tmpobj) 'works'
Catch
meldung.Text = "Stackoverflow- zuviele Ergebnisse "
myexception = True
End Try
I checked the server; it's a dwh server and has no problems to execute the program.
At first I used a ReDim Array
, but now I use a List(Of T)
. I heard that should solve the problem, but it doesn't - now I'm very confused and don't know what to do-
can someone help me please?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
更改
Catch
块,以便您实际上可以看到此处发生的情况:您可能不会在此处收到
StackOverflowException
。Change the
Catch
block so that you actually can see what is happening here:You are probably not getting a
StackOverflowException
here.我的浏览器崩溃了,所以我必须以访客身份编写:<对不起。
我尝试过:
抛出了“System.OutOfMemoryException”类型的异常。
现在我有一个正确的 for 循环,其中只有一行代码,
所以发生了什么? (服务器是 dwh 服务器,应该可以...)
谢谢
my browser crashed, so i have to write as an guest : < sorry.
i tried that:
Exception of type 'System.OutOfMemoryException' was thrown.
now i have an correct for loop, with only one line of code in it
so what happened? (the server is an dwh server, it should make it ...)
thanks