Solved

Dataset Accept Changes causing crash

Posted on 2013-06-26
3
164 Views
Last Modified: 2014-02-12
Hi
I have a calculation which I run against the rows of a datatable. The code below is run if the user picks the Count Policy option.
It runs fine if there are a thousand or so rows. However, over a certain number, this step will cause the program to crash.
I'm not sure exactly where in the procedure is causing the crash, but I do know that the report will complete if the User does not select the Count Policy option.

Private Sub Count_Policy()
Dim rowRenewal As RenewalsRow

For Each rowRenewal In Me.PolicyDataSet.Renewals
   rowRenewal.PolicyCount = Me.PolicyDataSet.Renewals.Compute("Count(BrokerRef)", "PolicyRef = '" & rowRenewal.PolicyRef & "'")
Next

Me.PolicyDataSet.Renewals.AcceptChanges()

End Sub

Open in new window


I suspect that are just too many rows for the AcceptChanges to process.
Any suggestions on how I could improve this code to not cause a crash? Note that I cannot change the way that data is loaded into the dataset, so please do not give any suggestions that involve SQL.
0
Comment
Question by:jdhackett
3 Comments
 
LVL 42

Expert Comment

by:sedgwick
ID: 39277764
what exception is being thrown?
0
 
LVL 1

Author Comment

by:jdhackett
ID: 39278027
No message appears on screen. The application just stops responding, and you have to end it from task manager.
I haven't been able to replicate the issue on my own PC, so I can't debug it from Visual Studio.
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 39278239
Do you know how long the user waits? It could be that the computation is still going on and app is not responding to user input so user is killing it. You can update UI to indicate the progress.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now