Vous êtes sur la page 1sur 3

VB.

NET INTERVIEW QUESTIONS COULD BE ASKED -

1-Difference Between Array and array list?


ANS - Array is the collection of values of the same data type
>the variables in an array is called array elements
>Array is a reference type data type
>The array structure in System's Memory

Array list is a class .


>when you want to access the elements of an array through its index value location in an array,use an
ArrayList.
>The use of the arraylist is an alternative to the use of th array.
>The Methods Of ArrayList class are
1)Add 2)Remove 3)Clear 4)Insert
5)TrimToSize 6)Sort 7)Reverse
ANS 2 --- Array are collection of values of same type.Array list are collection of objects of same type or different
type.
ANS 3 - 1.Arrays are built-in data structures in .NET, where as ArrayList must be imported from the .NET
Framework library.
2.Array is a primitive data structure, which stores the values in an indexed format, where as an
ArrayList is more like a vector, which can be resized. ArrayList is a Collection and stores all data as
Objects.
3.Arrays are not always the best structures to use if the size of the data is likely to change. Arrays
would give you the best results when you are working with strictly numeric values. Arrays are also
helpful when you need direct access to far-away elements in your data set.
4.ArrayLists are more useful when dealing with non-numeric data. Arrays are faster for calculation,
where as ArrayLists are faster for inserting elements.

ANS 4 - Arrays does not provide built-in functions like add(),remove(),removeAt(),insert(),and many more.
but arraylist provides all above.

2-What is the base class of .net?


System.object is for .Net

system.Web.UI is for asp.net

The super most base class is system.object. even the system.web.ui comes from the system.object. All
the object of type either value or reference type come from system.object. see the msdn doc for the
same.

3- How to store and retrieve images in SQL server database through VB.NET?
To store images in Sql Database you need to set the field to image in sql server then you have to
convert image to binary and then save to database location.

In vb.net, the images can be stored into database in the form of ByteArray.At the time of retrieving,we
can assign the byteArray to MemoryStream and then convert into image.

4- what is the difference between string and stringbuilder?

String is mutable means if we want to add something at the end of string then first it will remove that
string then it will write desired string.
String builder is immutable means while adding one more char at the end of string it directly upend the
string without remove original string.
5- Differences between VB.Net and C#, related to OOPS concepts

C# 1.supports pointers,XML documentation,operator overloading


2.case sensitive
3.statements ends with ";"
VB.Net 1.Doesn't support
2.not case sensitive
3.statement doesn't ends with ";"

C# is case sensitive and vb.net is user friendly.


C# application is compiled through csc compiler whereas Vb.net application is compiled through vbc
compiler.
C# supports delegates concept.Vb.net does not support it.

6- what is non_deterministic finalization?

The Finalize method is actually executed by the runtime on a special thread allocated by the Garbage
Collector (GC).The Finalize method is executed whenever the runtime feels it is appropriate, such as when a
low-resource condition occurs and this situation is often referred to as non-deterministic finalization.

7- What do you mean by Garbage Collection in VB.net ?

Garbage collection is the mechanism to release memory allocated by a objects / Veriables which are
no longer exists in programme.

In .NET Framework, garbage collector is implemented as a separate thread. This thread will always be
running at the back end. Since garbage collector always run at the back end there will be extra overhead for
the memory. Therefore garbage collector is given the lowest priority in .NET Framework. In .NET
Framework, garbage collection system is based on the Mark and Compact algorithm that involves removing
of objects that have gone out of scope and compacts all the remaining objects at the beginning of the address
space. The space allotted for the application is also referred to as managed heap. When a new object needs to
be instantiated and if there is not enough room in the application?s managed heap, the garbage collection
process starts.

8- How can we remove Handlers at Run time ?

RemoveHandler myobj.myEvent, AddressOf MyEventHandler

Private Sub ButtonAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


ButtonAdd.Click
AddHandler Button2.Click, AddressOf MyOtherClick
End Sub
Private Sub ButtonRemove_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
ButtonRemove.Click
RemoveHandler Button2.Click, AddressOf MyClick
End Sub

9- How do you define a read only property in a class module?

we can create a read only property by using the keyword "Read only" before the syntax .e.g
Read only property Property_name([args]) as type get [statement]
end get
end property
10- What is .net?
.Net is the Development Platform which provides advanced feature facilities for the web and window
application along with the window services . The .Net is the Middle layer between the operating System and
the .Net application .The feature of .Net that the .Net Component can talk with each other without worrying
about the language in which they are originally.. Two main components are CLR stands for the common
Language Runtime and the .Net FrameWork Base classes. The CLR performs the task of converting the IL to
native code Which gives the .Net applications to be language Independent . The Other component Like .Net
FramwWork Base Classes act as services to be provided to the .Net applications.
11- How VB Implements the Disonnected Architecture as like VB.Net?

In VB to implement a disconnected recordset, after you have filled the recordset with the data, set its
active connection property to "Nothing". That breaks the connection to the database.You can locally also save
the data of the recordset by using its Save function.

12- Explain about the keyword Must Inherit?

This keyword prevents a class from directly instantiated. This keyword forces users to create
references to only derived classes. This keyword is present in C# as abstract and it is very useful in creating
applications.

13- What are Console Applications in VB.NET?

Console Applications have only recently been introduced in VB (Excluding VB for DOS).
They are command line based and run in within a DOS Shell (DOS Window). Unlike Windows Applications,
Console Applications do not support Windows GUI's. Which means that you can't work with controls from
the toolbox.
To work with Console Applications select File->New->Project and in selected "Console Application" from
the template under Visual Basic or Visual C#.

Example (Sample.vb) of a Console Application.

Module Module 1
Sub Main ()
System.Console.WriteLine ("Hello World?)
End Sub
End Module

14- Whats the difference bt. .dll extension and .exe extension files?

.dll is the In process component where it take up the client's memory space to run. So the
communication between the application and component(dll) is very fast.

.EXE is the Out of process component. It uses its own memory(not application memory) to run the
component. The communication between the application and component is slow when compared to .dll

15- What is the source code for display the picture in button click event?

PictureBox1.Image = Image.FromFile("C:olympics08_basketball.gif")

16-

Vous aimerez peut-être aussi