TOP 69 VB .Net Multiple Choice Questions and Answers pdf fresher and experienced

Read the most frequently asked 69 top VB .Net multiple choice questions and answers PDF for freshers and experienced. VB .Net objective questions and answers pdf download free..

VB .Net Multiple Choice Questions and Answers PDF Experienced Freshers
1. What is the use of console application?
Console Applications are command-line oriented applications that allow us to read characters
from the console, write characters to the console and are executed in the DOS version. Console
Applications are written in code and are supported by the System. Console namespace.

2. How VB Implements the Disconnected 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.

3. What is the difference between .dll extension and .exe extension files?
The main difference between .dll and .exe is
.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

4. What is the base class of .net?
System. Object is the base class of .NET
It Supports
all classes in the .NET Framework class hierarchy and provides low-level services to derived classes. This is the ultimate super class of all classes in the .NET Framework; it is the root of the type hier

5. How to store and retrieve images in SQL server database through VB.NET?
Image file can be save in SQL server as a byte. Henceforth, the image is convert to a stream of byte using the IO.Memory Stream. This stream of byte can be save in a table with image data type.

6. What is different between Web.Config and Machine.Config and Where it will be ?
The settings made in the web.config file are applied to that particular web application only whereas the settings of machine.config file are applied to the whole asp.net application.

7. Differences between VB.Net and C#, related to OOPS concepts
VB.NET is a windows application where as C# is a console.

8. 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.

9. How do you define a read only property in a class module?
Public Class YourClass
Private yourName As String
Private yourNumber As Decimal
Public Sub New(breed As String)
yourName = breed
End Sub

Public ReadOnly Property Name() As String
Get
Return yourName
End Get
End Property

10. What is the source code for display the picture in button click event?
PictureBox1.Image = Image.FromFile("C:olympics08_basketball.gif")

11. What do you mean by Option Strict On?
Option Strict On will restrict the implicit type casting (defalut is off in vb.net)

12. What are Jagged Arrarys ?
Jagged array is an array inside an array is called a jagged array

13. How can we remove Handlers at Run time?
Remove Handler myobj.myEvent, AddressOf MyEventHandler

14. How to send xml file on server using HTTP protocol?
Through SOAP Protocol

15. What is STA in .NET?
STA is Store Accumulator

16. What is the advantage of option strict on?
Visual Basic allows conversions of many data types to other data types. Data loss can occur when the value of one data type is converted to a data type with less precision or smaller capacity. A run-time error occurs if such a narrowing conversion fails. Option Strict ensures compile-time notification of these narrowing conversions so they can be avoided.
In addition to disallowing implicit narrowing conversions, Option Strict generates an error for late binding. An object is late bound when it is assigned to a variable that is declared to be of type Object.

Because Option Strict On provides strong typing, prevents unintended type conversions with data loss, disallows late binding, and improves performance, its use is strongly recommended.

What you can't do with Option Strict On, is accessing members of objects that are not declared as a specific object type. You must have a typed reference.

17. What do you mean by Serialization and Deserialization and its use?
To store the vb.net for data into an xml file is called Serialization. To load data from xml file to vb.net form is called DeSerialization.

18. What is MISL CODE?
When compiling to the managed code , your source code is translated to microsoft intermediate language code( MSIL), which is cpu-indenpendent set of instructions that can be effectively converted to native code.

19. What is Late Binding and Early Binding?
Late Binding: runtime binding
Early Binding: compile time binding as compilation is done before executing an application so it is called early binding.

20. What is the exact defination of Object?
A real world entity which has some specific attributes related to its characteristics and operations or methods associated with its attributes.

21. What are the difference between dispose(), close(), exit(), end()? When do we use them?
dispose(): should release all the resources that it owns.
close():closing the application
exit():Exiting from the loop
end():stops the execution of the page/function/procedure

22. What is the advantage of packaging over xcopy in .NET?
With the help of xcopy we solve the problem of DLL HELL and com dependencies and when we make xcopy of project all the dll, dependencies, assembly are updated automaticaly it's a powerful feature of .NET

23. What is the difference between DataTable and DataSet?
Data set can store many tables but a data table can have one table only.

24. What is the significance of delegates. Where should they be used? What are the situations where we require them?
Delegates are used as pointer to hold the controls actually i used the delegates when there is problem in VB.Net 2005 where each control is already threaded, to use my personla thread on these control i used delegates
Ex:
Private Delegate Sub dd()
Dim d1 As New dd(AddressOf c1)
Dim t1 As New Threading.Thread(AddressOf thread1)
public sub Thread1()
r1 =
Me.Label1.BeginInvoke(d1)
Me.Label1.EndInvoke(r1)
end sub
Public Sub c1()
Me.Label1.Text = ct1
Me.Label1.Refresh()
End Sub

25. What is the size of .NET object?
Default size when a class gets loaded in memory is 8 bytes.

26. How to create Crystal Report in vb.net with coding?
Just configure the report data source by database

27. What are the objects in asp.net and tell the purpose of those objects?
Here are 5 objects in asp.net
1.Response:This object is to response to other e.g.:
2.Request:This object is request from server
3.Application: This object is store global information of application.
4.Session:This object used store the values into variable.
5.Server:

28. When we will use console ?
Console is used only for web application

29. Display a roll having minimum marks in two subjects?
Select id from table1 where sub1=(select min(sub1)from table1)and sub2=(select min(sub2)from table1)

30. In vb.net how to connect crystal report?
Click on solution explorer window right click and add to add new item. The window will be displaced select the crystal reports we have save in any name but extension is used .rpt eg:sss.rpt

31. Explain the differences between Server-side and Client-side code?
Server side code executes on the server.For this to occur page has to be submitted or posted back.Events fired by the controls are executed on the server.Client side code executes in the browser of the client without submitting the page.
e.g. In ASP.NET for webcontrols like asp:button the click event of the button is executed on the server hence the event handler for the same in a part of the code-behind (server-side code). Along the server-side code events one can also attach client side events which are executed in the clients browser i.e. javascript events.

32. How would you implement inheritance using VB.NET/C#?
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.

33. What is the difference between an XML "Fragment" and an XML "Document."
An XML fragment is an XML document with no single top-level root element. To put it simple it is a part (fragment) of a well-formed xml document. (node) Where as a well-formed xml document must have only one root element.

34. What does it meant to say "the canonical" form of XML?
"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.

35. Why is the XML InfoSet specification different from the Xml DOM? What does the InfoSet attempt to solve?
"The XML Information Set (Infoset) defines a data model for XML. The Infoset describes the abstract representation of an XML Document. Infoset is the generalized representation of the XML Document, which is primarily meant to act as a set of definitions used by XML technologies to formally describe What parts of an XML document they operate upon.
The Document Object Model (DOM) is one technology for representing an XML Document in memory and to programmatically read, modify and manipulate a xml document.
Infoset helps defining generalized standards on how to use XML that is not dependent or tied to a particular XML specification or API. The Infoset tells us What part of XML Document should be considered as significant information.

36. Whats the difference between const and readonly?
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;

37. Can you create enumerated data types in C#?
Yes.

38. Whats different about switch statements in C#?
No fall-throughs allowed.

39. What happens when you encounter a continue statement inside the for loop?
The code for the rest of the loop is ignored, the control is transferred back to the beginning of the loop.

40. How can you sort the elements of the array in descending order?
By calling Sort() and then Reverse() methods.

41. Whats the C# equivalent of C++ catch (...), which was a catch-all statement for any possible exception?
A catch block that catches the exception of type System.Exception. You can also omit the parameter data type in this case and just write catch {}.

42. Whats the implicit name of the parameter that gets passed into the class set method?
Value, and it's datatype depends on Whatever variable we're changing.

43. How do you inherit from a class in C#?
Place a colon and then the name of the base class. Notice that it's double colon in C++.

44. So how do you retrieve the customized properties of a .NET application from XML .config file? Can you automate this process?
Initialize an instance of AppSettingsReader class. Call the GetValue method of AppSettingsReader class, passing in the name of the property and the type expected. Assign the result to the appropriate variable. In Visual Studio yes, use Dynamic Properties for automatic .config creation, storage and retrieval.

45. Why is it not a good idea to insert code into InitializeComponent method when working with Visual Studio?
The designer will likely through it away, most of the code inside InitializeComponent is auto-generated.

46. Where do you add an event handler?
It's the Attributesproperty, the Add function inside that property.
e.g. btnSubmit.Attributes.Add(""onMouseOver"",""someClientCode();"")

47. What is a delegate, why should you use it and how do you call it ?
A delegate is a reference type that refers to a Shared method of a type or to an instance method of an object. Delegate is like a function pointer in C and C++. Pointers are used to store the address of a thing. Delegate lets some other code call your function without needing to know where your function is actually located. All events in .NET actually use delegates in the background to wire up events. Events are really just a modified form of a delegate.
It should give you an idea of some different areas in which delegates may be appropriate:
1.They enable callback functionality in multi-tier applications as demonstrated in the examples above.
2.The CacheItemRemoveCallback delegate can be used in ASP.NET to keep cached information up to date. When the cached information is removed for any reason, the associated callback is exercised and could contain a reload of the cached information.
3. Use delegates to facilitate asynchronous processing for methods that do not offer asynchronous behavior.
4.Events use delegates so clients can give the application events to call when the event is fired. Exposing custom events within your applications requires the use of delegates.

48. How does the XmlSerializer work?
XmlSerializer in the .NET Framework is a great tool to convert Xml into runtime objects and vice versa
If you define integer variable and a object variable and a structure then how those will be plotted in memory.
Integer , structure - System.ValueType -- Allocated memory on stack , infact integer is primitive type recognized and allocated memory by compiler itself .
Infact , System.Int32 definition is as follows :
[C#]
[Serializable]
public struct Int32 : IComparable, IFormattable, IConvertible
So , it's a struct by definition , which is the same case with various other value types .
Object - Base class , that is by default reference type , so at runtime JIT compiler allocates memory on the "Heap" Data structure .
Reference types are defined as class , derived directly or indirectly by System.ReferenceType

49. Explain about visual basic?
Visual basic is associated with the IDE of Microsoft. It is basically useful to implement RAD of GUI. Creation of Active X scripts are very easy and efficient through VB. Windows API can also be used to create application on windows desktop and its applications. This was primarily designed to create applications for windows platform.

50. Explain about .NET?
.NET is a Microsoft Framework and a software component. .NET has a large library of pre-coded solutions which provided developer significant help in developing applications with solutions already present. It offers reliable security and cross platform compatibility.

51. Name some of the features present in VB 2005?
Some of the features present in VB 2005 are as follows: -
? Edit and continue: - It allows developers to modify and execute applications almost simultaneously.
? Namespace: - This provides access to various parts of the .NET framework and it also dynamically generates classes.
? Data source binding function is very useful for client server development.

52. Explain and brief about rapid application development tool?
Rapid action development tool describes about the software development process. This tool gives flexibility in iterative development and prototype deployment. It enhances the speed of application development. It is also used for application maintenance.

53. Describe about Visual basic.NET?
This is used in conjunction with Microsoft .NET platform and is a successor to visual basic sixth version. Visual basic is used in conjunction with.NET Framework. This tool has a serious defect it is not compatible with Microsoft visual basic sixth version. It has a huge library which assists programmers.

54. What are the various open source tool available for VB.NET?
When compared with the rapid development of open source tools for other languages from Microsoft (C#, etc) we can say that development of tools for VB has been slow. Mono development platform is one which is implementing VB libraries and is working on a compiler.

55. Explain about the performance of Visual basic?
Visual basic 5 and 6 are efficient in coding the code to native or P-code depending upon the programmer. Portability is a major addition to the performance of VB.NET and the code is also small. Additional layer is provided which interprets the code and this can be avoided by using special algorithms and native code programming.

56. Compare C# and Visual basic.NET?
.NET Frame work includes two languages which are language to IL compilers and in this C# and VB.NET are provided. The importance and flexibility of these as better programming languages is still questionable. Visual basic has been updated and revised to make it object oriented whereas C# has concepts from many languages such as Delphi, Java, etc and syntax from C and Java.

57. Explain about Visual basic.NET culture?
VB was always a RAD tool and it was always user friendly for any type of user whether professional or not. It also provided many users with shortcuts and features which made this language popular among many users. It had its share of debugging and maintenance issues of course.

58. Name and explain some of the exclusive features which are present in VB?
Some of the features which are exclusive to VB are as follows: -
1) Name space can be hidden which can be disabled.
2) Certain project files can be hidden and a user can show them if he intends to do.
3) Lots and lots of shortcuts are present which ease the development of programs.
4) Using the AddressOf myObject function a delegate can be made.

59. Name a feature which is common to all .NET languages?
There is only one feature which is common to all languages and that is Garbage collection or GC. This feature is automated which relieves developers of much work. This garbage is disposed only when there is need of memory or stress for memory. GC feature halts the application for few seconds before restarting it.

60. Name some of the features of C# which are not present in VB.NET?
Some of the features which are not present in VB are as follows they are: -
1) It supports unsafe code blocks for improved performance.
2) Partial interfaces and anonymous methods.
3) Multi line comments and static classes. Etc

61. 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.

62. What would you do to remove Microsoft visual basic name space?
.NET has many new features and application supportive tools. To remove Microsoft visual basic name space all you have to do is to
1) Remove the import manually every time you start the project.
2) Creating a template which does not contain Microsoft Visual Basic namespace.
3) About new features and changes names you can refer to MSDN.

63. Which is the tool which can convert Visual basic old version to .NET compatibility version?
There is a tool available which can convert old visual basic functions into new .NET code. Artin soft Visual basic upgrade Companion is very useful in converting VB code into .NET code. This tool was developed by Artin. This tool is integrated in Visual studio.NET 2005. It handles programs such as structured handling, error handling, etc.

64. Explain about the feature Anonymous type?
Anonymous type is a feature of VB.NET and it allows data types to be created from the code which requires it. This feature is present in VB as well as C#. They should be stored in variables declared with the keyword VAR. Dynamic typing is different and shouldn’t be confused with Anonymous type.

65. Explain about the Ruby interface generator?
Ruby interface generator is primarily responsible for providing the visual part of the Visual basic and this was clubbed with “EB” designed for Omega database system. VBX interface was added to this feature which had the ability to load dynamic link libraries.

66. What is DataType conversion in VB.NET ?
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.

67. What is branching logic control in vb.net?
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.

68. Write the role of New keyword?
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.

69. What is difference between import System.Data.SqlClient,System.Data.Oledb?
System.Data.OleDB It contains the objects that we use to connect to a data source via an OleDB provider , such as OleDbConnection, OleDBCOmmand. System.Data.SqlClient It contains objects that we use to connect to a data source via Tabular data stream interface provided by Microsoft Sql Server. This can be generally used to provide better performance because it removes some of the intermediate layers required by the OleDB provider.

0 comments:

Post a Comment