Select Category 
 

VB.Net Interview Questions Answers

VB.Net Interview Question - 1 : -

So can a COM object talk to a .NET object?

VB.Net Interview Answer - 1 : -

Yes, through Runtime Callable Wrapper (RCW) or PInvoke.
 

VB.Net Interview Question - 2 : -

Why is it a bad idea to throw your own exceptions?

VB.Net Interview Answer - 2 : -

 

Well, if at that point you know that an error has occurred, then why not write the proper code to handle that error instead of passing a new Exception object to the catch block? Throwing your own exceptions signifies some design flaws in the project.

 

VB.Net Interview Question - 3 : -

What is branching logic control in vb.net ?

VB.Net Interview Answer - 3 : -

Function and subroutines are the answer.The diffrence in two of them is function send information back from where it is called means function can return a value but subroutines can not do this.
 

VB.Net Interview Question - 4 : -

 What's the difference between const and readonly?

VB.Net Interview Answer - 4 : -

 

The readonly keyword is different from the const keyword. A const field can only be initialized at the declaration of the field. A readonly field can be initialized either at the declaration or in a constructor. Therefore, readonly fields can have different values depending on the constructor used. Also, while a const field is a compile-time constant, the readonly field can be used for runtime constants as in the following example:
public static readonly uint l1 = (uint) DateTime.Now.Ticks;

 

VB.Net Interview Question - 5 : -

What is DataType conversion in VB.NET ?

VB.Net Interview Answer - 5 : -

Convert one variable type to another one is called datatype conversion we can also caleed this casting in VB.NET some automatically conversion is also there.
Cbool CByte CChar Cdate CDec CDbl CInt CLng CObj CShort CSng CStr CType Asc.
 

VB.Net Interview Question - 6 : -

What does \a character do?

VB.Net Interview Answer - 6 : -

On most systems, produces a rather annoying beep.
 

VB.Net Interview Question - 7 : -

What is the difference between DataTable and DataSet ?.

VB.Net Interview Answer - 7 : -

Dataset: Represents an in-memory cache of data we can also say data set is a collection of data table it is based on xml format ,it is used for data storing in cache as a disconnected recordset dataset is using data manipulation in cache wthout connection to database. DataTable: Represents one table of in-memory data data table can have one table only or we can say Data table is a collection of record's that consist the single table ..
 

VB.Net Interview Question - 8 : -

How do you convert a string into an integer in .NET?Int32.Parse(string)
 

VB.Net Interview Question - 9 : -

Write the role of New keyword ?

VB.Net Interview Answer - 9 : -

New is used to initialize a new object. We sets a variable to any dattype with help of New keyword .The New keyword gives a value to the variable.We can also uses new keyword to initialize an object variable.
Example:- dim obj as new SqlDataAdapter.
 

VB.Net Interview Question - 10 : -

What does it meant to say “the canonical” form of XML?

VB.Net Interview Answer - 10 : -

 

"The purpose of Canonical XML is to define a standard format for an XML document. Canonical XML is a very strict XML syntax, which lets documents in canonical XML be compared directly.
Using this strict syntax makes it easier to see whether two XML documents are the same. For example, a section of text in one document might read Black & White, whereas the same section of text might read Black & White in another document, and even in another. If you compare those three documents byte by byte, they'll be different. But if you write them all in canonical XML, which specifies every aspect of the syntax you can use, these three documents would all have the same version of this text (which would be Black & White) and could be compared without problem. This Comparison is especially critical when xml documents are digitally signed. The digital signal may be interpreted in different way and the document may be rejected.

 

VB.Net Interview Question - 11 : -

What's the difference between // comments, /* */ comments and /// comments?

VB.Net Interview Answer - 11 : -

 

Single-line, multi-line and XML documentation comments.

 

VB.Net Interview Question - 12 : -

How is a property designated as read-only?

VB.Net Interview Answer - 12 : -

 

In VB.NET:

Private mPropertyName as DataType
Public ReadOnly Property PropertyName() As DataType
    Get Return mPropertyName
    End Get
End Property

 

VB.Net Interview Question - 13 : -

Are COM objects managed or unmanaged?

VB.Net Interview Answer - 13 : -

  Since COM objects were written before .NET, apparently they are unmanaged.
Any code not written in the Microsoft .NET framework environment is UNMANAGED. So naturally COM+ is unmanaged because it is written in Visual Basic 6.
 

VB.Net Interview Question - 14 : -

How would you implement inheritance using VB.NET/C#?

VB.Net Interview Answer - 14 : -

When we set out to implement a class using inheritance, we must first start with an existing class from which we will derive our new subclass. This existing class, or base class, may be part of the .NET system class library framework, it may be part of some other application or .NET assembly, or we may create it as part of our existing application. Once we have a base class, we can then implement one or more subclasses based on that base class. Each of our subclasses will automatically have all of the methods, properties, and events of that base class ? including the implementation behind each method, property, and event. Our subclass can add new methods, properties, and events of its own - extending the original interface with new functionality. Additionally, a subclass can replace the methods and properties of the base class with its own new
implementation - effectively overriding the original behavior and replacing it with new behaviors. Essentially inheritance is a way of merging functionality from an existing class into our new subclass. Inheritance also defines rules for how these methods, properties, and events can be merged. In VB.NET we can use implements keyword for inheritance, while in C# we can use the sign ( :: ) between subclass and baseclass
 

VB.Net Interview Question - 15 : -

What's different about namespace declaration when comparing that to package declaration in Java?

VB.Net Interview Answer - 15 : -

 

No semicolon.