Solved

Dataset Accept Changes causing crash

Posted on 2013-06-26
3
174 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Visual Studios 1 76
Create a datatable in vb.net dynamically 1 22
VB.Net - String Manipulation Scenario 2 25
How can I do Unit Testing with Session ? 1 10
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

856 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