Link to home
Start Free TrialLog in
Avatar of ptphil54
ptphil54

asked on

Visual Basic To .NET

How Do you transfer Visual Baisc Code to .NET coding?
Avatar of ptphil54
ptphil54

ASKER

This is Semi-Urgent. College Student with 2 semesters of VB under their belt!
ASKER CERTIFIED SOLUTION
Avatar of Arthur_Wood
Arthur_Wood
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
>>but rather PURE .NET controls

What you said is true for intrinsic controls but have you tried datagrid, dbcombo, imagecombo, ...
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
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!!!
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... :)
Please do NOT accept my joke as the answer.