C# Tutorials and offshore development in India
Tutorials Resources Forum Reviews Communities Interview Jobs Projects Training Videos


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...


Birthday Greetings
Learn Windows 7: Fix for the error: Thumbnails Not Showing Properly in Vista   Here I would like to share with you a guide on how to fix the error, Thumbnails Not Showing Properly in Vista.



Resources » Articles » .NET Framework »

Migrating from VB 6.0 to VB.NET - Some Tips


Posted Date: 07 Feb 2005    Resource Type: Articles    Category: .NET Framework
Author: Venkat BSMember Level: Gold    
Rating: 1 out of 5Points: 10


Are you planning to migrate your old VB 6 application to VB.NET ? This articles give some basic idea on migrating vb projects to vb.net.



MIGRATION TIPS FROM VB 6.0 TO VB.NET

Points to consider when you migarate your code from VB 6.0 to VB.Net

Data Type Changes

  • VB.NET has no currency data type. Instead it provides decimal as a replacement.

  • VB.NET introduces a new data type called Char. The char data type takes 2 bytes and can store Unicode characters.

  • VB.NET do not have Variant data type. To achieve a result similar to variant type you can use Object data type. (Since every thing in .NET - including primitive data types - is an object, a variable of object type can point to any data type).

  • In VB.NET there is no concept of fixed length strings.

  • In VB6 we used the Type keyword to declare our user defined structures. VB.NET introduces the structure keyword for the same purpose. The rest of the syntax is same.

  • The Visual Basic 6.0 Long datatype is now the Visual Basic .NET Integer datatype, and the Visual Basic 6.0 Integer datatype is now the Visual Basic .NET Short datatype.


  • Variable Declaration

  • All variables must be declared with appropriate data type. Dim x (Not allowed)


  • Arrays

  • Arrays are zero based index by default


  • Error Handling

  • On error resume next error handling statements will work in VB.Net but advised to use Try.. Catch.. block.


  • Property Syntax

  • Visual Basic .NET introduces a more intuitive syntax for properties, which groups Get and Set together. Your property statements are upgraded as shown in the following example:



  • Property Get MyProperty() As Integer
    MyProperty = m_MyProperty
    End Property
    Property Let MyProperty(NewValue As Integer)
    m_MyProperty = NewValue
    End Property

    is upgraded to:

    Property MyProperty() As Short
    Get
    MyProperty = m_MyProperty
    End Get
    Set
    m_MyProperty = Value
    End Set
    End Property

    Others
  • All subroutines should enclose with paranthesis

  • VB.NET no longer supports default properties. You must explicitly specify the property you wish to access from an object.






  • Responses to the resource: "Migrating from VB 6.0 to VB.NET - Some Tips"

    No responses found. Be the first to respond and make money from revenue sharing program.

    Feedbacks      
    Popular Tags   What are tags ?   Search Tags  
    Sign In to add tags.
    (No tags found.)

    Post Feedback


    This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
    You must Sign In to post a response.
    Next Resource: Exploring Strongly Typed DataSet
    Previous Resource: Globalization of Web Applications using ASP.NET
    Return to Resources
    Post New Resource
    Category: .NET Framework


    Post resources and earn money!
     
    More Resources



    About Us    Contact Us    Privacy Policy    Terms Of Use