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

  • 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:":

'UPGRADE_ISSUE: Load statement is not supported.

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

1 Solution
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):


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.

MikeMCSDAuthor Commented:
Thank you Mr. Wood!

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