Answer: There are quite a few differences in VB6 and VB.NET. We will highlight some of these here in points:
* 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.
There are quite a few differences in VB6 and VB.NET. We will highlight some of these here in points:
* 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: CoolInterview.com
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
There should not be any Spelling Mistakes.
There should not be any Gramatical Errors.
Answers must not contain any bad words.
Answers should not be the repeat of same answer, already approved.
Answer should be complete in itself.
Related Questions
View Answer
Sir my name is riyaz and my question is Object class in VB.net supports all classes in .net frameworks iam creating DLL where i created a function
Public Sub BindListControl( ByVal Lst As Listbox, ByVal sql As String, ByVal TextField As String, Optional ByVal ValueFld As String = "") Dim ds As New DataSet Dim Ad As New SqlDataAdapter Dim Cmd As New SqlCommand
Try If cnn2.State = ConnectionState. Closed Then OpenConnection2( )
With Cmd .Connection = cnn2 .CommandType = CommandType. Text .CommandText = sql End With Ad = New SqlDataAdapter( Cmd) Ad.Fill(ds, "tmp") Lst.DataTextField = TextField If ValueFld <> "" Then Lst.DataValueField = ValueFld End If Lst.DataSource = ds Lst.DataBind( )
Catch ex As Exception Current.Response. Write(ex. Message) Finally ds.Dispose() Ad.Dispose() Cmd.Dispose( ) 'cnn2.Close( ) End Try End Sub ------------ --------- --------- --------- --------- --------- - and Then i replaced function with Object ------------ --------- --------- --------- --------- --------- -
Public Sub BindListControl( ByVal Lst As Object, ByVal sql As String, ByVal TextField As String, Optional ByVal ValueFld As String = "") Dim ds As New DataSet Dim Ad As New SqlDataAdapter Dim Cmd As New SqlCommand
Try If cnn2.State = ConnectionState. Closed Then OpenConnection2( )
With Cmd .Connection = cnn2 .CommandType = CommandType. Text .CommandText = sql End With Ad = New SqlDataAdapter( Cmd) Ad.Fill(ds, "tmp") Lst.DataTextField = TextField If ValueFld <> "" Then Lst.DataValueField = ValueFld End If Lst.DataSource = ds Lst.DataBind( )
Catch ex As Exception Current.Response. Write(ex. Message) Finally ds.Dispose() Ad.Dispose() Cmd.Dispose( ) 'cnn2.Close( ) End Try End Sub ------------ --------- --------- --------- --------- --------- - It will sucessfully work but if do it in c# as
public void BindListBox( ListBox Lst, string sqlquery, string TextField, string value) { //ListBox Lst; //Lst = (ListBox)sender; SqlConnection con = new SqlConnection( ); con.ConnectionStrin g = cnnstring; con.Open(); if (con.State.ToString () == "Open") { SqlDataAdapter adapater = new SqlDataAdapter( sqlquery, con); DataSet Ds = new DataSet(); SqlCommandBuilder cmd = new SqlCommandBuilder( adapater) ; try {
} else { Response.Write( "Connection Not Available"); } } -------------------------------------- It will work with ListBox control ----------------------------------- if i replace ListBox with Object it will through Error that object does not contain defination for DataTextField, DataSource, DataBind( ) so sir it will work in vb.net why not in c# is any alternate way to do this or any other syntax please send me response as earily as possible Thank u sir
I want to use picture box control and the Images in the picture box should change according to my selection plz specify the codes relating to this.....
Is it possible to create a folder on the specified location in the database through VB.net. My Requirement is to create a folder on the given location in the database .
1)What is the difference between vb and vb.net ? 2)How to insert row by row data in datagrid ? 3) How to work with repeater controls and give small example program ?