App crashing will calling dataset.merge

atomic928

New member
Joined
May 13, 2011
Messages
1
Programming Experience
10+
Please forgive me in advance for I am new to Database programming in VB.

I have an application that I inherited and this app is crashing because of all the memory getting eaten up. I have traced the problem down to a dataset.merge call.
The app preloads all the forms/pages before running and the forms/pages are loaded in a method that does a loop. In this loop it does a bunch of form setup along with calling the ‘merge’.

The offending line in this loop is:
frmToLaunch.myDSData.Merge(myRefData)

and the objects are declared as:

Partial Class myDBLocal
Partial Class RL_InventoryDataTable
End Class
End Class

Private myRefData As New Schemas. myDBLocal
Public WithEvents myDSData As Schemas. myDBLocal
ByVal frmToLaunch As FormBase


My questions are:
  1. Is there any reason why the merge has to be called on each form load?
  2. Can one not have the databases, myRefData and myDSData, as a global, and only do one merge, say before the looping of loading the pages?
  3. Are myDSData and myRefData objects copies of the database myDBLocal or are they datasets?
  4. Does anyone know why the call to 'merge' eats up so much memory?
  5. If any one has an example of how a global merge or a proper way to handle associating the merge with forms/pages I would appreciate it.
I’d appreciate any comments and/or help.

Thanks
 
I dont think anyone on an internet forum will be able to answer those questions without seeing the program's code and having access to the DB, sorry..
 
Back
Top