?
Solved

Visual Basic To .NET

Posted on 2003-11-07
12
Medium Priority
?
259 Views
Last Modified: 2013-12-04
How Do you transfer Visual Baisc Code to .NET coding?
0
Comment
Question by:ptphil54
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +2
12 Comments
 

Author Comment

by:ptphil54
ID: 9701482
This is Semi-Urgent. College Student with 2 semesters of VB under their belt!
0
 
LVL 44

Accepted Solution

by:
Arthur_Wood earned 252 total points
ID: 9701641
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
 
LVL 70

Assisted Solution

by:Éric Moreau
Éric Moreau earned 248 total points
ID: 9705301
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
Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 9707586
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
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 9710071
>>but rather PURE .NET controls

What you said is true for intrinsic controls but have you tried datagrid, dbcombo, imagecombo, ...
0
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 9712203
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
 
LVL 2

Expert Comment

by:selim007
ID: 9721050
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
 
LVL 5

Expert Comment

by:TRUENEUTRAL
ID: 9733953
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
 
LVL 5

Expert Comment

by:TRUENEUTRAL
ID: 10322094
Please do NOT accept my joke as the answer.
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Simple Linear Regression

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question