0

VB(Visual Basic) .Net Quiz

Description: VB(Visual Basic) .Net Quiz
Number of Questions: 13
Created by:
Tags: .net vb
Attempted 0/13 Correct 0 Score 0

Where do you find COMException class

  1. System.Runtime.Interopservices

  2. System.XML

  3. System. Data


Correct Option: A

Which method of the XMLdocument class takes xml as string while loading

  1. Loadxml ( )

  2. Load( )

  3. Save ( )


Correct Option: A

Which is the base class for TypedDataset

  1. DataReader

  2. Dataset

  3. DataAdapter


Correct Option: B
Explanation:

To answer this question, the user should be familiar with the concept of typed datasets and their relationship to other classes in the .NET framework.

The correct answer is:

B. Dataset

Explanation:

In the .NET framework, the base class for typed datasets is the Dataset class. A typed dataset is a dataset that is derived from the Dataset class and includes additional features such as strongly-typed data tables and data columns.

A. DataReader is not the base class for TypedDataset. The DataReader class is used for reading data from a database and does not have a direct relationship to typed datasets.

C. DataAdapter is also not the base class for TypedDataset. The DataAdapter class is used for retrieving and updating data from a database, but it is not the base class for typed datasets.

Therefore, the correct answer is B. Dataset.

Which is the best to retrieve Read-Only, Forward-only stream of data from database

  1. Data Set

  2. Typed Data Set

  3. DataReader


Correct Option: C

AI Explanation

To answer this question, you need to understand the different ways to retrieve data from a database.

Option A) Data Set - This option is incorrect because a Data Set is an in-memory representation of data that allows you to store and manipulate data from multiple tables. It is not specifically designed for retrieving a read-only, forward-only stream of data.

Option B) Typed Data Set - This option is incorrect because a Typed Data Set is a subclass of a Data Set that provides strongly-typed access to the data. Like a regular Data Set, it is not specifically designed for retrieving a read-only, forward-only stream of data.

Option C) DataReader - This option is correct because a DataReader is a lightweight, forward-only, read-only stream of data from a database. It provides efficient access to data by retrieving one row at a time, which is useful when you only need to read the data and do not need to modify it. The DataReader is commonly used when performance is a concern or when working with large result sets.

The correct answer is C) DataReader. This option is correct because it provides a read-only, forward-only stream of data from a database.

Which of the method is used to display the form as modal

  1. Showdialog( )

  2. Activate ( )

  3. Loaddialog()

  4. Show( )


Correct Option: A

The tool provided with .Net framework to register assemblies for use by COM is

  1. Regsvr32

  2. Regasm

  3. ILDASM

  4. Regedit


Correct Option: B

AI Explanation

To answer this question, you need to understand the .NET framework and its integration with COM (Component Object Model).

The correct answer is B) Regasm.

Regasm (Registration Assembly) is the tool provided with the .NET framework to register assemblies for use by COM. It is used to register a .NET assembly as a COM component. This allows the .NET assembly to be accessed and used by COM clients.

Option A) Regsvr32 is not the correct answer. Regsvr32 is a tool used to register and unregister DLL files in the Windows operating system, but it is not specifically used for registering .NET assemblies for use by COM.

Option C) ILDASM (IL Disassembler) is a tool used to view the Intermediate Language (IL) code of a .NET assembly, but it is not used for registering assemblies for use by COM.

Option D) Regedit is a Windows registry editor tool. It is not specifically used for registering .NET assemblies for use by COM.

Therefore, the correct answer is B) Regasm.

How do you add Web Methods in VB.Net

  1. Add keyword to Method signature

  2. Add [WebMethod] on top of the Method Signature

  3. Add {WebMethod} on top of the Method Signature


Correct Option: A

How do you refer the current class in VB.Net

  1. Me

  2. This

  3. Super


Correct Option: A
Explanation:

To refer to the current class in VB.Net, you would use the "Me" keyword.

A. Me: This option is correct. In VB.Net, "Me" is a keyword that represents the current instance of the class. It can be used to access the members and properties of the current class.

B. This: This option is incorrect. In VB.Net, "This" is not used to refer to the current class. Instead, "This" is used in other programming languages like C# to refer to the current instance of a class.

C. Super: This option is incorrect. In VB.Net, "Super" is not used to refer to the current class. Instead, "Super" is used in other programming languages like Java to refer to the superclass or base class.

The Answer is: A. Me

How you refer the parent class in VB.Net

  1. Parent

  2. MyBase

  3. Super


Correct Option: B
Explanation:

To refer to the parent class in VB.Net, we use the keyword "MyBase". Therefore, the correct answer is:

The Answer is: B. MyBase

The serialization of an Object means that it is written out to a stream

  1. True

  2. False


Correct Option: A
  1. Assert( )

  2. Open()

  3. Flush( )


Correct Option: B
Explanation:

To solve this question, the user needs to have knowledge about the Debug class and its methods.

The Debug class is a class in C# that provides a set of methods, properties, and events to assist in debugging applications. It is mainly used for debugging purposes, such as tracing, logging, and error handling.

Now, let's go through each option and explain why it is right or wrong:

A. Assert( ): This is a method of the Debug class, which is used to check whether a condition is true or false. If the condition is false, it will stop the execution of the program and display an error message. Therefore, option A is not the correct answer.

B. Open(): This method is not a part of the Debug class. It is a method of the File class, which is used to open a file in the specified mode. Therefore, option B is the correct answer.

C. Flush( ): This is a method of the Debug class, which is used to clear the output buffer and send any pending messages to the listeners. Therefore, option C is not the correct answer.

The Answer is: B

Vb.Net classes can be derived in C#

  1. True

  2. False


Correct Option: A
- Hide questions