Home

1000+ Visual Basic .NET Multiple Choice Question Answer [Solved]

Thursday 9th of March 2023

Sharing is caring

1. If you want to open a file named "a.txt" use
A. System.diagnostics.Start("a.txt")
B. System.Start("a.txt")
C. System.diagnostics.Process.Start("a.txt")
D. System.Process.Start("a.txt")
Answer : C
2. DataSet can be used to connect to Crystal Report
A. True
B. False
C.
D.
Answer : A
3. /*1. OleDataAdapterq1.update(DataSet1,"emp")
2. OleDataAdapterq1.update(DataSet1,"std")
3. DataSet1.Merge(DataSet1)
4. DataSet1.AcceptChanges()
/* The error is in line

A. 2
B. 4
C. 3
D. No Error
Answer : D
4. In ADODB the _____________ property is used to connect to the table
A. RecordSet
B. DataSource
C. RecordSource
D. Connection
Answer : A
5. In ListView the item that is currently selected is determined by
A. SelectedItem
B. Item
C. FocussedItem
D. GetSelected
Answer : C
6. ________ converts to long datatype
A. Clong
B. CLng
C. Lng
D. None of the above
Answer : B
7. If Scrollbars property of a TextBox is set to Hortizontal and the WordWrap property is also set to true. Which one will get precedence
A. Scrollbars
B. WordWrap
C. No precedence both will work
D.
Answer : B
8. Use a _________ statement to make Visual Basic object the default object for a set of enclosed Visual Basic statements.
A. With
B. Using
C. Import
D. Inherit
Answer : A
9. ___________ is used to pass copies of a variable while __________ is used to pass address of a variable.
A. Byval, Byref
B. Byref, Byval
C. Any one of the above
D. None of the above
Answer : A
10. A form can have only ______ Main Menu and _________ Context Menu
A. 1,1
B. 1,Multiple
C. Multiple,1
D. 1,2
Answer : B
11. This view is not present in VB.NET
A. Project Explorer
B. Class View
C. Resource View
D. Server Explorer
Answer : A
12. A DataSet can be updated only when the connection is open
A. True
B. False
C.
D.
Answer : B
13. What cannot be done if the table has no primary key
A. Insert and Update
B. Update and Delete
C. Select and Delete
D. Insert and Select
Answer : B
14. If a Form is Inherited from another Form and both Forms have certain codes in their respective Form_Load event, then while running the program
A. Only the first Forms code will be executed
B. Only the second Forms code will be executed
C. Both Forms code will be executed
D. None of the above
Answer : C
15. If MustOverride is used then ____________ is also a must.
A. Overridable
B. Inherits
C. MustInherit
D. None of the above
Answer : C
16. This property of TrackBar is not present
A. TickStyle.Both
B. TickStyle.None
C. TickStyle.TopLeft
D. TickStyle.BottomLeft
Answer : D
17. If a form call another form and the caller form is closed through code, then both forms are disposed
A. True
B. False
C.
D.
Answer : A
18. If a Label control's AutoSize property is set to True, can you resize the control
A. Yes
B. No
C.
D.
Answer : B
19. A thread can be started only once
A. True
B. False
C.
D.
Answer : A
20. The SelectionMode property of a CheckedList Box can be set only to
A. One
B. MultiSimple
C. MultiExtended
D. None of the abvove
Answer : A
21. A MsgBox can have maximum ___________ button(s)
A. 1
B. 2
C. 3
D. 4
Answer : C
22. The EventLog's ________ method is used to write an entry to a log file
A. WriteLine
B. WriteEntry
C. Add
D. Append
Answer : B
23. Function abc() As String
Return 10
End Function

A. Will produce compilation error
B. Will produce runtime error
C. The function will execute normally
D. None of the above
Answer : A
24. You create a UserControl having a TextBox and include that in a separate Form. Can you use all the properties of the TextBox in the UserControl from that Form?
A. Yes
B. No
C.
D.
Answer : B
25. Using ADODB multiple tables can be connected at a time
A. True
B. False
C.
D.
Answer : B
26. A form can have only one default button
A. True
B. False
C.
D.
Answer : A
27. /*1. Class C
2. public notoverridable sub abc()
3. msgbox("Base Class")
4. end sub
5. end Class /* The Error in Line No.

A. 2
B. 3
C. 4
D. No Error
Answer : A
28. Using OLEDB you can connect more than one table
A. True
B. False
C.
D.
Answer : A
29. If an user-defined class have a user-defined event then, the class object is declared as
A. Dim c as new ClassName
B. Dim withEvents c as new ClassName
C. Dim c as ClassName
D. Dim withEvents c as ClassName
Answer : B
30. To uninstall a Windows Service ____________ is use
A. Installutil -I
B. Installutil -e
C. Installutil -u
D. Installutil -d
Answer : C
31. Images can be loaded from
A. Images.FromFile
B. BitMap.FromFile
C. System.FromFile
D. Both a and b
Answer : D
32. _________ and _____________ combines to make a KeyPress event
A. KeyUp, KeyDown
B. KeyEnter, KeyRelease
C. KeyDown, KeyRelease
D. KeyEnter, KeyUp
Answer : A
33. VB.NET supports Multi Level Inheritance
A. True
B. False
C.
D.
Answer : A
34. Dim S as Integer=10
Text1=S
Msgbox(Text1.Text)

A. Will return error
B. Will return 10
C. Will return 0
D. Will return Null
Answer : A
35. This view pops up if "Ctrl+F1" is pressed
A. Help
B. Properties Window
C. Dynamic Help
D. Server Explorer
Answer : C
36. To retrieve the default path of the project use
A. Application.Path
B. Application.DefaultPath
C. Application.StartupPath
D. Application.ProjectPath
Answer : C
37. DomainUpDown control is used only for strings and NumericUpDown for numbers.
A. True
B. False
C.
D.
Answer : B
38. You can assign a Main Menu to any control
A. True
B. False
C.
D.
Answer : B
39. If a Class in inherited, its constructor is inherited automatically and it is fired automatically
A. True
B. False
C.
D.
Answer : A
40. PasswordChar property of a TextBox can accept " " (space) as the password char
A. True
B. False
C.
D.
Answer : B
41. While handling keystrokes if e.Handled=True is set then Visual Basic
A. Will handle the key
B. Will not handle the key
C. Will send the key to Garbage collector
D. None of the above
Answer : B
42. dim arr(10) as string,
the max index of the array is

A. 9
B. 10
C. Can be >10 also
D. None of the above
Answer : B
43. To override Finalize function the scope of the function must be
A. Private
B. Public
C. Protected
D. Static
Answer : C
44. The default event handler of TextBox is
A. KeyPress
B. Changed
C. TextChanged
D. Validating
Answer : C
45. In OLEDB database can be accessed without using DataSet
A. True
B. False
C.
D.
Answer : A
46. Only derived class can have shadows keyword
A. True
B. False
C.
D.
Answer : A
47. Data from DataSet is accessed using34
A. Binding Obejct
B. BindContext Object
C. BindingContext Object
D. EndCurrentEdit Object
Answer : C
48. A function can have multiple return statements
A. True
B. False
C.
D.
Answer : B
49. For the same class "Me" and MyBase" are same
A. True
B. False
C.
D.
Answer : A
50. To make a button the default button, this property of the form must be set
A. DefaultButton
B. AcceptButton
C. DialogResult
D. None of the above
Answer : B

Sharing is caring