• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 263
  • Last Modified:

Visual Basic To .NET

How Do you transfer Visual Baisc Code to .NET coding?
0
ptphil54
Asked:
ptphil54
  • 3
  • 2
  • 2
  • +2
2 Solutions
 
ptphil54Author Commented:
This is Semi-Urgent. College Student with 2 semesters of VB under their belt!
0
 
Arthur_WoodCommented:
open Visual Studio.NET 2003, then under the File menu, select the Open/File and navigate to the path of the VB 6 .vbp file.  That will invoke the Upgrade wizard which will then attempt to convert the Code and forms in the VB 6 project to VB.NET.  when the 'upgrade' is complete, a report will be generated. indicating any task that remain to be carried out manually.  You will also find these tasks on the Tasks Tab at the bottom of the VS screen.


just did this with a fairly sophiticated app (VB 6) that I downloaded from the web, and all of the code, EXCEPT four lines in one form upgraded perfectly.  The code that did not was of very minor significance, so the upgraded .NET version runs almost perfectly, and the upgrade required about 5 minutes.!!!!


AW

0
 
Éric MoreauSenior .Net ConsultantCommented:
I don't believe that VB6 can be well upgraded to .Net.
-wrappers are added around VB6 controls to be used in .Net (meaning that you will need to deploy the controls and VB6 runtimes). XCopy deployment and no-touch deployement won't work.
-Code won't use new features such as inheritance, polymorphism, new controls, ...
-Many lines won't be upgraded.

Having said that, I consider that you better rewrite your app or simply keep it in VB6.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
Arthur_WoodCommented:
actually, the controls upgrade VERY cleanly, and are NOT wrappers around the OCX's, but rather PURE .NET controls (at least for the standard toolbox controls - Text Box, Command Button, CHeck Box, etc)
.

Actually VS 2003 does a VERY good job - as I said, I had one recent downloaded VB 6 app, not TERRIBLY sophisticated, but a demo for a Matrix Manipulation library, which upgraded almot 100% - only 4 lines on one minor form, an those were of little of n significance.  When i simply commented out the failed lines, the pp run perfectly, fiirst time I pressed f5!!!.

Yes, it is true that "Code won't use new features such as inheritance, polymorphism, new controls, ..", but it will get you started,  And I agree that it would be best to ONLY use the upgrade wizard under VERY VERY controlled situations.  Do not use it to 'upgrade' a real, Mission critical app.  And do not expect to get the full advantage of .NET when you do upgrade.

AW
0
 
Éric MoreauSenior .Net ConsultantCommented:
>>but rather PURE .NET controls

What you said is true for intrinsic controls but have you tried datagrid, dbcombo, imagecombo, ...
0
 
Arthur_WoodCommented:
no, but I avoid the Databoyund controls like the plague.  I prefere to do ALL data handling and display is unbouind controls, so the I control exactly what happens and when.  And trying to use data bound controls from VB6, in a .NET app is an invitation to disaster.  .NET's approach to 'data-bound' controls is 100% diametrically opposite to that used in VB 6, and the use of recordsets (or in the .NET case Datasets, Datareaders, etc) is so different, that any attempt to move from the former tot latter is again inviting disaster.

As we have both said, "it would be best to ONLY use the upgrade wizard under VERY VERY controlled situations", and Databound controls are OUTSIDE those parameters, in my mind.

Attempting to 'upgrade' any really 'significant' VB 6 application is a serious MISTAKE, and should be considered as the sign of a total lack of understanding of the nature of the .NET platform and paradigm.

AW
0
 
selim007Commented:
i agree on that Arthur_Wood,
.Net is completly different from the previous versions of visual studio.
it's not recommended to upgrade projects from vb6 to .net if the application is very complex and contains many 3rd party controls and dlls.
otherwise, if it's a simple application, you can easly upgrade it, few lines may fail to upgrade then u'll have to do it manually.
i have many applications built on vb6, now i am switching to .net and rebuilding everything from the ground up!!!
0
 
TRUENEUTRALCommented:
Hey, just look at this as an opportunity to refactor all that crappy code you wrote years ago when you were in a hurry. Uhh... well... maybe you are still in hurry... in that case, look at it as an opportunity to write new crappy code based on old crappy code... :)
0
 
TRUENEUTRALCommented:
Please do NOT accept my joke as the answer.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 3
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now