VB.NET Interview Questions and Answers (91) - Page 3

What is the difference between early binding and late binding in VB.NET ?

Calling a non-virtual method, at a compile time is known as early binding.
Calling a virtual method (Pure Polymorphism), at a runtime is known as late binding.
What is the differences between dataset.clone and dataset.copy in VB.NET ?

Dataset.clone just copies the structure of dataset (including all the datatables, schemas, relations and constraints.); however it doesn’t copy the data.
Dataset.copy copies both the dataset structure and the data.
What is portable executable in VB.NET?

portable executable is a file format which is used for executable programs and for files to be linked together to form executable programs.
What is a formatter in VB.NET?

A formatter is an object that is responsible for encoding and serializing data into messages on one end, and deserializing and decoding messages into data on the other end.
What is Side-by-Side Execution in VB.NET ?

The CLR allows any versions of the same-shared DLL (shared assembly) to execute at the same time, on the same system, and even in the same process. This concept is known as side-by-side execution.
What is reflection in VB.NET ?

All .NET compilers produce metadata about the types defined in the modules they produce. This metadata is packaged along with the module (modules in turn are packaged together in assemblies), and can be accessed by a mechanism called reflection.
How to run a Dos command in Vb.net?

To run a DOS command in VB.NET, the following codeis used:

Shell("cmd.exe /c c:\first.exe < in.txt > out.txt")

Write a program to implement the ++ Operator in VB.Net


Function IncrementOperator(ByRef value As Integer) As Integer
value += 1
Return value
End Function

How many ways to compare String values in Dot Net?

NOTE: This is objective type question, Please click question title for correct answer.
Which statement is False about Optional parameters in VB.Net?

NOTE: This is objective type question, Please click question title for correct answer.
How many ways to remove Last character from String in Dot Net?

NOTE: This is objective type question, Please click question title for correct answer.
In VB.Net Overloads keyword is used for which type? Public Overloads Function GetEmployee() As String End Function Public Overloads Function GetEmployee(ByVal employee_id As Integer) As String End Function

Overloads keyword is used in Function Overloading in VB.Net,but it's not necessary to write Overloads keyword in function.

We can simply write the same method as follows:

Public Function GetEmployee() As String

End Function

Public Function GetEmployee(ByVal employee_id As Integer) As String
End Function

What will be the output of Result variable? Dim result as Boolean Dim str as String = Nothing result = String.IsNullOrEmpty(str)

NOTE: This is objective type question, Please click question title for correct answer.
How to get the path for "My Documents" and other system folders

We can Use GetFolderPath method of the System.Environment class to retrieve this information.

For Example:-

Dim Path as String = 

Environment.GetFolderPath(Environment.SpecialFolder.Personal)

How to get the path to my running EXE?

The Application class has a static member ExecutablePath that has this information.

Dim exe_path as String = Application.ExecutablePath

How to get a file's name from the complete path string without file Extension.

We use System.IO.Path.GetFileNameWithoutExtension static methods to get the file name.

For Example:-

Dim path1 as String = 

System.IO.Path.GetFileNameWithoutExtension ("string_file_path")

How to get a file's name from the complete path string With file Extension.

We use System.IO.Path.GetFileName static method to get the file name.

For Example:-

Dim path1 as String = 

System.IO.Path.GetFileName("string_file_path")

What is an alternate way of showing messages instead of MessageBox.Show() method?

We can also have MsgBox in-built
VB.Net function which has the same functionality as MessageBox.Show() method.

For Example:-

MsgBox("Hello")

MessageBox.Show("Hello")

How to get Random Number in VB.Net?

With the help of Rnd() in-built
function or method,we can get random
number,every-time when it's called,will generate Random number.

For Example:-

MsgBox(Rnd())

How to get only Year from DataPart?

With the help of Year method,we can get Year from Date-part.
It returns Integer number.

For Example:-

MsgBox("Year would be" & Year(Now()))

Found this useful, bookmark this page to the blog or social networking websites. Page copy protected against web site content infringement by Copyscape

 Interview Questions and Answers Categories