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:
Thanks
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:
- Is there any reason why the merge has to be called on each form load?
- 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?
- Are myDSData and myRefData objects copies of the database myDBLocal or are they datasets?
- Does anyone know why the call to 'merge' eats up so much memory?
- 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.
Thanks