Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 231
  • Last Modified:

Upgraded VB6 to .NET . . a few problems

Upgraded VB6 to .NET . . a few problems.
I need the correct code where there is "'UPGRADE_NOTE:":

1.
'UPGRADE_ISSUE: Load statement is not supported.
Load(frmSupp)

2.
If rsNewType.State = ADODB.ObjectStateEnum.adStateOpen Then
  rsNewType.Close()
  'UPGRADE_NOTE: Object rsNewType may not be destroyed until it is garbage collected.
  rsNewType = Nothing
End If

thanks
0
MikeMCSD
Asked:
MikeMCSD
1 Solution
 
Arthur_WoodCommented:
1) forms in VB.NET are classes that you do not LOAD, but rather create an instance of:

Dim frm as New frmSupp

and then show the form as a Dialog (modal form):

frm.ShowDialog()

tghere is no underlying Forms collection as there was in VB 6.

2) is simply advising you that .NET does NOT have DETERMINISTIC object release.  In vb 6, when you set an object reference to Nothing, the object was removed from memory.  In .net, the object is not removeds from memory until Garbage Collection takes place, and you have no direct control over when that happens - but the refenercve is gone, so whether the object is still in memory or not is irrelevant - you cannot access the object once it is set to Nothing.  The memory will be released when the application needs to make use of the memory for other purposes (that is what GC -Garbage Collection- is all about).

#2 is not a error, just advising you about how .NET is different from VB 6.

#1 IS an ERROR - the method does not exist any longer.

AW
0
 
MikeMCSDAuthor Commented:
Thank you Mr. Wood!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now