VB.NET - Difference between vb and vb.net - Asked By Gayathri on 24-Mar-11 12:16 AM

 Hai, I want to know about the main difference between vb and vb.net.
Kirtan Patel replied to Gayathri on 24-Mar-11 12:23 AM
  • The greatest change in VB6 and VB.NET is of runtime environment. VB6 used the VB-Runtime while VB.NET uses the .Net Common Language Runtime (.Net CLR). The CLR is much better designed and implemented than VB-Runtime. The CLR uses better code translation through Just in Time compiler while VB-Runtime interprets the code. The CLR Garbage Collector is also more efficient than VB6 one as it may detect cyclic references too.
  • VB6 was interpreter based language while VB.NET is a compiled language
  • VB6 was not a type-safe language while VB.NET is a type safe language. There is no variant type in VB.NET and no magical type conversions happen in VB.NET
  • VB6 used ‘On Error Goto’ syntax to handle exceptions at runtime. VB.NET uses the Try…Catch…Finally syntax to handle exceptions at runtime.
  • A lot of code (like user interface code) in VB6 was hidden from developer. In VB.NET no code is hidden from developer and you can access and control each part of your application
  • VB.NET has much enhanced object oriented support than VB6
  • VB6 does not allow developing the multithreaded applications. In VB.NET you can create multithreaded applications.
  • VB6 was only considered good for desktop windows application. In VB.NET you can also develop web applications, distributed applications, create .NET windows and web controls and components, write windows and web services.
  • In VB.NET, you can also use reflections to read the meta-data of types and using reflection emit you can also generate code to define and invoke types at runtime.
  • VB.NET uses .NET framework class library along with specialized VB library (System.VisualBasic) as a standard library. As a result, the standard library for VB.NET is much enhanced and useful compared to VB6 standard library
  • VB.NET is platform independent because of .Net framework. Programs written in VB.NET can run on any platform where .Net framework is present. The platform include both hardware and software (operating system) platforms.
  • VB.NET also supports language interoperability with various .NET compliant languages. This means that you can use and enhance the code written in other .NET compliant languages. Similarly the code written in VB.NET can also be used and enhanced by other .NET compliant languages. Although VB6 also provided this functionality through COM but it was limited and difficult to use and manage. VB.Net makes it easier because of the presence of Intermediate Language (IL) and Common Language Specification (CLS) of the .NET architecture.
  • VB6 uses COM (Component Object Model) as component architecture. VB.NET uses assemblies as its component architecture. The Assemblies architecture has removed a lot of problems with COM including DLL-Hell and versioning problem.
  • Components created in VB6 (COM) need to make and update registry entries. VB.NET does not require any registry entry making the deployment easier
  • VB6 used ASP to build web applications. VB.NET uses ASP.NET to build web applications.
  • VB6 used ADODB and record-sets to implement data access applications. VB.NET uses ADO.NET and datasets to build data access applications. The ADO.NET also supports the disconnected data access.
  source : http://www.programmersheaven.com/2/FAQ-VBNET-VB6-VBNET-Differences
Sahil Kumar replied to Gayathri on 24-Mar-11 12:24 AM
Hi,

    Now VB.NET is object-oriented language. The following are some of
the differences:
Data Type Changes
The .NET platform provides Common Type System to all the supported
languages. This means that all the languages must support the same
data types as enforced by common language runtime. This eliminates
data type incompatibilities between various languages. For example
on the 32-bit Windows platform, the integer data type takes 4 bytes
in languages like C++ whereas in VB it takes 2 bytes. Following are
the main changes related to data types in VB.NET:
. Under .NET the integer data type in VB.NET is also 4 bytes in size.
. 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.
Declaring Variables
Consider this simple example in VB6:
Dim x,y as integer
In this example VB6 will consider x as variant and y as integer,
which is somewhat odd behavior. VB.NET corrects this problem,
creating both x and y as integers.
Furthermore, VB.NET allows you to assign initial values to the
variables in the declaration statement itself:
Dim str1 as string = Hello
VB.NET also introduces Read-Only variables. Unlike constants Read-
Only variables can be declared without initialization but once you
assign a value to it, it cannot be changes.
Initialization here
Dim readonly x as integer
In later code
X=100
Now x can't be changed
X=200 *********** Error **********
Property Syntax
In VB.NET, we anymore don't have separate declarations for Get and
Set/Let. Now, everything is done in a single property declaration.
This can be better explained by the following example.
Public [ReadOnly | WriteOnly] Property PropertyName as Datatype
Get
Return m_var
End Get
Set
M_var = value
End Set
End Property
Example:
Private _message as String
Public Property Message As String
Get
Return _message
End Get
Set
_message = Value
End Set
End Property
ByVal is the default - This is a crucial difference betwen VB 6.0
and VB.NET, where the default in VB 6.0 was by reference. But
objects are still passed by reference.
Invoking Subroutines In previous versions of VB, only functions
required the use of parentheses around the parameter list. But in
VB.NET all function or subroutine calls require parentheses around
the parameter list. This also applies, even though the parameter
list is empty.
User-Defined Types - VB.NET does away with the keyword Type and
replaces it with the keyword Structure
Public Structure Student
Dim strName as String
Dim strAge as Short
End Structure
Procedures and Functions
In VB6 all the procedure parameters are passed by reference (ByRef)
by default. In VB.NET they are passed by value (ByVal) by default.
Parantheses are required for calling procedures and functions
whether they accept any parameters or not. In VB6 functions returned
values using syntax like: FuntionName = return_value. In VB.NET you
can use the Return keyword (Return return_value) to return values or
you can continue to use the older syntax, which is still valid.
Scoping VB.NET now supports block-level scoping of variables. If
your programs declare all of the variables at the beginning of the
function or subroutine, this will not be a problem. However, the
following VB 6.0 will cause an issue while upgrading to VB .NET
Do While objRs.Eof
Dim J as Integer
J=0
If objRs("flag")="Y" then
J=1
End If
objRs.MoveNext
Wend
If J Then
Msgbox "Flag is Y"
End If
In the above example the variable J will become out of scope just
after the loop, since J was declared inside the While loop.
Exception Handling
The most wanted feature in earlier versions of VB was its error
handling mechanism. The older versions relied on error handlers such
as "On Error GoTo and On Error Resume Next. VB.NET provides us with
a more stuructured approach. The new block structure allows us to
track the exact error at the right time. The new error handling
mechanism is refered to as Try...Throw...Catch...Finally. The
following example will explain this new feature.
Sub myOpenFile()
Try
Open "myFile" For Output As #1
Write #1, myOutput
Catch
Kill "myFile"
Finally
Close #1
End try
End Sub
The keyword SET is gone - Since everything in VB.NET is an object.
So the keyword SET is not at all used to differentiate between a
simple variable assignment and an object assignment. So, if you have
the following statement in VB 6.0
Set ObjConn = Nothing
Should be replaced as
ObjConn = Nothing.
Constructor and Destructor
The constructor procedure is one of the many new object-oriented
features of VB.NET. The constructor in VB.NET replaces the
Class_Initialize in VB 6.0. All occurance of Class_Initialize in
previous versions of VB should now be placed in a class constructor.
In VB.NET, a constructor is added to a class by adding a procedure
called New. We can also create a class destructor, which is
equivalent to Class_Terminate event in VB 6.0, by adding a sub-
procedure called Finalize to our class. Usage of Return In VB.NET,
we can use the keyword return to return a value from any function.
In previous versions, we used to assign the value back with the help
of the function name itself. The following example explains this:
Public Function Sum (intNum1 as Integer, intNum2 as Integer) as
Integer
Dim intSum as Integer
intSum = intNum1 + intNum2
Return intSum
End Function
Static Methods
VB.NET now allows you to create static methods in your classes.
Static methods are methods that can be called without requiring the
developer to create instance of the class. For example, if you had a
class named Foo with the non-static method NonStatic() and the
static method Static(), you could call the Static() method like so:
Foo.Static()
However, non-static methods require than an instance of the class be
created, like so:
Create an instance of the Foo class
Dim objFoo as New Foo()
Execute the NonStatic() method
ObjFoo.NonStatic()
To create a static method in a VB.NET, simply prefix the method
definition with the keyword Shared.


follow this link for more details

http://www.programmersheaven.com/2/FAQ-VBNET-VB6-VBNET-Differences

I hope this will help you.
div v replied to Gayathri on 24-Mar-11 01:11 AM
VB 6 programs require significant modification to run under VB .NET
 
VB6 was interpreter based language while VB.NET is a compiled language
 
The greatest change in VB6 and VB.NET is of runtime environment. VB6 used the VB-Runtime while VB .NET adheres to the Common Language Specification (CLS) for language interoperability which is also shared with C#.
 
VB 4, 5, and 6 were backward compatible VB .NET is not backward compatible
 
VB6 was not a type-safe language while VB.NET is a type safe language. There is no variant type in VB.NET and no type conversions happen automatically in VB.NET
 
VB6 used the ‘On Error Goto’ syntax to handle exceptions at runtime. VB.NET uses the Try…Catch…Finally syntax to handle exceptions at runtime.
 
Changes to Procedure Calls
 
A lot of code (like user interface code) in VB6 was hidden from developer. In VB.NET no code is hidden from developer and you can access and control each part of your application and it now has C-like Syntax
 
VB .NET is now has object oriented programming features
 
Arrays is  0 based in VB .NET. i.e when you declare an array in vb6 "Dim Items(5) As String" you would get an array with 6 elements but in VB.NET it would be 5 items now.
 
No More Variant, Currency Data Types in VB.NET, you also get the new data types in Visual Basic. NET called Object other changes are as follow.
 
 VB2008.NET  VB6    Difference
 Short  Integer  16 Bit
 Integer    Long   32 Bit
 Long      64 Bit
 Object Variant    Variant Dropped use the new Object Data Type
 Decimal    
 String  String  No Fixed Length String in Vb.NET
   Currency    Use Decimal or long in vb2008
 
VB6 does not allow developing the multithreaded applications. In VB.NET you can create multithreaded applications.
 
VB6 was only considered good for desktop windows application. In VB.NET you can develop web applications, distributed applications, create .NET windows and web controls and components, write windows and web services.
 
In VB.NET, you can also use reflections to read the meta-data of types and using reflection emit you can also generate code to define and invoke types at runtime.
 
VB.NET uses .NET framework class library along with specialized VB library (System.VisualBasic) as a standard library. As a result, the standard library for VB.NET is much enhanced and useful compared to VB6 standard library
 
VB.NET is platform independent because of .Net framework. Programs written in VB.NET can run on any platform where .Net framework is present. The platform include both hardware and software (operating system) platforms.
REF this link:

http://www.thescarms.com/vbasic/VB6vsVBNet.aspx