.Net Preliminary Test! Check Your Proficiency! Trivia Quiz

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By 569461_tcs
5
569461_tcs
Community Contributor
Quizzes Created: 2 | Total Attempts: 607
| Attempts: 547 | Questions: 30
Please wait...
Question 1 / 30
0 %
0/100
Score 0/100
1. The .NET Framework provides a run time environment called ..... ?

Explanation

The correct answer is CLR, which stands for Common Language Runtime. The CLR is a component of the .NET Framework that provides a run time environment for executing and managing .NET applications. It provides services such as memory management, exception handling, and security. The CLR also includes a Just-in-Time (JIT) compiler that converts the Intermediate Language (IL) code into machine code for execution.

Submit
Please wait...
About This Quiz
DotNET Quizzes & Trivia

Below is a. Net preliminary test perfectly designed to check your proficiency! NET is a framework that provides a programming guidelines that can be used to develop a... see morewide range of applications while making use of different computer languages. By taking the quiz you will get to see if you might need a refresher so as to understand everything about this framework. All the best as you tackle. see less

2. Find the term: The .NET framework provides automatic memory management using a technique called ______________ ?

Explanation

The correct answer is Garbage Collection. The .NET framework uses a technique called Garbage Collection to automatically manage memory. Garbage Collection is a process where the runtime environment automatically identifies and frees up memory that is no longer being used by the program. This helps to prevent memory leaks and improves the overall performance and efficiency of the application.

Submit
3. In the body of a method, C# uses the keyword named_____ to refer the current instance of a class.

Explanation

In C#, the keyword "this" is used to refer to the current instance of a class within the body of a method. This allows us to access the members and methods of the current object. By using "this", we can avoid naming conflicts between local variables and instance variables in the class.

Submit
4. If one has two different web form controls in a application and wanted to know whether the values in the above two different web form control match.  What control must be used?

Explanation

The CompareValidator control is used to compare the values of two different web form controls in an application. It allows the developer to specify the type of comparison (e.g. equal, not equal, greater than, etc.) and display an error message if the values do not match. This control is useful in scenarios where data validation is required, such as checking if a password and its confirmation match.

Submit
5. How many classes can a single .NET DLL contain?

Explanation

A single .NET DLL can contain many classes. In .NET, a DLL (Dynamic Link Library) is a file that contains compiled code and resources that can be used by multiple applications. It serves as a container for various classes and other components. These classes can be accessed and utilized by other programs, making it possible to have multiple classes within a single DLL file. Therefore, the correct answer is "Many".

Submit
6. A variable declared inside a method is called a________variable.

Explanation

A variable declared inside a method is called a local variable. Local variables are only accessible within the method or block of code in which they are declared. They are temporary and are destroyed once the method or block of code has finished executing.

Submit
7. Find any errors in the following BankAccount constructor:     public int BankAccount() {        balance = 0;     }

Explanation

The given code snippet is attempting to define a constructor for a BankAccount class. However, constructors do not have a return type, so the "int" return type specified in the code is incorrect. Constructors are used to initialize the object's state and do not return any value. Therefore, the correct answer is "ReturnType".

Submit
8. In ASP.NET the < authorization > section contain which of the following elements?

Explanation

The section in ASP.NET contains both the and elements. These elements are used to specify access control rules for different users or roles. The element is used to deny access to a specific user or role, while the element is used to explicitly allow access to a specific user or role. By using both elements, developers can define fine-grained access control rules for their applications.

Submit
9. Which method do you invoke on the DataAdapter control to load your generated dataset with data?

Explanation

The correct answer is Fill(). The Fill() method is used to load a dataset with data from a data source. It takes the dataset as a parameter and populates it with the data retrieved from the data source. This method is commonly used with the DataAdapter control in ADO.NET to retrieve data from a database and fill a dataset for further processing or display.

Submit
10. Which of the following denote ways to manage state in an ASP.Net Application?

Explanation

Session, Application, and ViewState are all ways to manage state in an ASP.Net Application.

- Session state allows storing and retrieving values for a user session across multiple requests.
- Application state allows storing and retrieving values that are accessible to all users of the application.
- ViewState allows storing and retrieving values for a specific page.

Therefore, all of the mentioned options (Session, Application, and ViewState) are correct ways to manage state in an ASP.Net Application.

Submit
11. ASP.NET separates the HTML output from program logic using a feature named as?

Explanation

ASP.NET separates the HTML output from program logic using a feature called Code Behind. This feature allows developers to write the program logic in a separate file, typically with a .cs or .vb extension, while keeping the HTML markup in the .aspx file. This separation enhances the maintainability and readability of the code, as it allows developers to focus on their respective tasks without mixing them together. The Code Behind file contains event handlers, business logic, and other server-side code that interacts with the HTML elements and controls defined in the .aspx file.

Submit
12. Which of the following denote the property in every validation control?

Explanation

The correct answer is "All of the above" because all three options - Text, ControlToValidate, and ErrorMessage - are properties that are present in every validation control. The Text property is used to specify the text that needs to be validated, the ControlToValidate property is used to specify the control that needs to be validated, and the ErrorMessage property is used to specify the error message that is displayed when the validation fails. Therefore, all three properties are essential in every validation control.

Submit
13. The proper way to convert a string to all lowercase is:

Explanation

The correct answer is "string.ToLower();". This is because the ToLower() method is a built-in function in many programming languages that converts a string to all lowercase letters. By calling this method on the string variable directly, we can achieve the desired result of converting the string to lowercase.

Submit
14. If two StringBuilder objects contain the same string then

Explanation

The given correct answer states that if two StringBuilder objects contain the same string, they are two different objects. This means that even though the two objects may have the same content, they are separate entities in memory. Therefore, any changes made to one StringBuilder object will not affect the other object.

Submit
15. What tags one need to add within the asp:GridView tags to bind columns manually?

Explanation

To bind columns manually within the asp:GridView tags, one needs to set the AutoGenerateColumns property to false on the gridview tag. This will disable the automatic generation of columns and allow the user to manually define the columns.

Submit
16. You are a database developer for Woodgrove Bank. You are implementing a process that loads data into a SQL Server database. As a part of this process, data is temporarily loaded into a table named "Staging". When the data load process is complete, the data should be deleted from this table. You will never need to recover this deleted data. You need to ensure that the data from the Staging table is deleted as quickly as possible. What should you do?

Explanation

Using a TRUNCATE TABLE statement is the most efficient way to delete data from a table. Unlike the DELETE statement, which removes rows one by one, the TRUNCATE TABLE statement removes all rows from the table at once. This results in faster deletion and less transaction log usage. The DROP TABLE statement would delete the entire table, including the table structure, which is not required in this scenario. Using an updateable cursor to remove each row one by one would be slower and less efficient compared to using the TRUNCATE TABLE statement.

Submit
17. Polymorphism occurs when the methods of the child class

Explanation

Polymorphism occurs when the methods of the child class maintain the same return type and arguments as the parent class, but implement them differently. This means that the child class can override the implementation of the parent class method while still maintaining the same method signature. This allows for flexibility in the code, as different objects of the same parent class can be treated differently based on their specific implementation of the method.

Submit
18.  In .NET the operation of reading metadata and using its contents is known as ______?

Explanation

Reflection in .NET refers to the ability of a program to examine and modify its own structure, behavior, and metadata at runtime. It allows the program to dynamically discover and use information about types, methods, properties, and other members of assemblies. Reflection is commonly used for tasks such as loading assemblies dynamically, accessing and invoking methods dynamically, creating instances of types dynamically, and inspecting and modifying attributes and metadata of types. Therefore, the correct answer for the given question is Reflection.

Submit
19. In ASP.NET the sessions can be dumped by using

Explanation

Session.Abandon is the correct answer because it is a method in ASP.NET that is used to abandon the current session and release all resources associated with it. When Session.Abandon is called, the session state is cleared and the session is terminated. This means that all data stored in the session is lost and a new session will be created for the user on their next request. It is commonly used when a user logs out or when their session needs to be forcibly ended.

Submit
20. You want to execute a DELETE SQL query on a table in the database. You want to retrieve the number of rows that were deleted. What code should you use?

Explanation

The correct answer is to use the "cmd.ExecuteNonQuery()" method. This method is used to execute a SQL query that does not return any data, such as a DELETE query. It returns the number of rows affected by the query, which in this case would be the number of rows deleted from the table.

Submit
21. Which of the following can be used to add alternating color scheme in a Repeater control?

Explanation

The AlternatingItemTemplate can be used to add an alternating color scheme in a Repeater control. This template allows for different styling to be applied to the items in the Repeater control, alternating between two different styles. This can be useful for improving the readability and visual appeal of the control, especially when displaying a large number of items.

Submit
22. In order to use the for-each statement, what interface needs to be implemented by the target class?

Explanation

The correct answer is IEnumerable. The for-each statement in C# is used to iterate over a collection of items. In order to use this statement, the target class needs to implement the IEnumerable interface. This interface provides the necessary methods for iterating over the collection, such as GetEnumerator(). By implementing IEnumerable, the target class allows its objects to be used in a for-each loop, making it easier to iterate over its elements.

Submit
23. Class String and the Char structure found in the:

Explanation

The correct answer is the System namespace because the System namespace is a root namespace in the .NET framework that contains fundamental classes and base types. It includes classes like String and Char, which are commonly used for manipulating and working with strings and characters. The other namespaces mentioned, such as System.Strings, System.Chars, and System.Text, do not exist in the .NET framework and are not valid namespaces.

Submit
24. You are a database developer for a sales organization. Your database has a table named Sales that contains summary information regarding the sales orders from salespeople. The sales manager asks you to create a report of the salespeople who had the 20 highest total sales.Which query should you use to accomplish this?

Explanation

This query is the correct answer because it selects the top 20 salespeople based on their total sales. The SELECT statement retrieves the LastName, FirstName, and the sum of the OrderAmount for each salesperson. The GROUP BY clause groups the results by LastName and FirstName, allowing for the calculation of the total sales for each salesperson. The ORDER BY clause sorts the results in descending order based on the third column, which is the sum of the OrderAmount. Finally, the TOP 20 keyword limits the results to the top 20 salespeople with the highest total sales.

Submit
25. What is the top .NET class that everything is derived from?

Explanation

The top .NET class that everything is derived from is System.Object. In the .NET framework, all classes are derived from the Object class, which is the root of the class hierarchy. This means that every class in .NET inherits certain properties and methods from the Object class, such as ToString(), GetHashCode(), and Equals(). Therefore, System.Object is the correct answer.

Submit
26. Which of these statements correctly declares a two-dimensional integer array in C#?

Explanation

The correct answer is "int[,] myArray;". This statement correctly declares a two-dimensional integer array in C#. The "int[,]" syntax indicates that the array is two-dimensional, while "myArray" is the name given to the array.

Submit
27. Which of the following allow writing formatted output?

Explanation

The correct answer is "Both". Both Response.Write() and Response.Output.Write() allow writing formatted output. Response.Write() is a method that writes a string of text directly to the output stream, while Response.Output.Write() is a method that writes formatted text to the output stream. Both methods can be used to display formatted output in a web application.

Submit
28. What is the base class from which all Web forms inherit?

Explanation

All Web forms inherit from the base class "Page". This class provides the basic functionality and properties that are common to all web pages. It allows developers to create and customize web pages by adding controls, handling events, and managing the page lifecycle. The "MasterPage" is a separate concept in ASP.NET that allows for creating a consistent layout and design across multiple web pages, but it is not the base class from which all Web forms inherit.

Submit
29. You use a DataTable to load data from the Orders Table from a database. The Orders table contains two columns: Quantity, and UnitPrice. You want to add another column, which computes the total price using the formula : TotalPrice=Quantity*UnitPrice. What code will you use to add this third column to the DataTable?

Explanation

The correct answer is "dataTable.Columns.Add(new DataColumn("TotalPrice", typeof(Double), "Quantity * UnitPrice"));" because it correctly adds a new column named "TotalPrice" of type Double to the DataTable. The third argument in the DataColumn constructor specifies the expression used to compute the values for the column, which in this case is "Quantity * UnitPrice".

Submit
30. Which of the following must be done in order to connect data from some data resource to GridView control?

Explanation

To connect data from a data resource to a GridView control, the DataSource property needs to be set to specify the source of the data. After setting the DataSource property, the DataBind method should be called to bind the data to the GridView control and display it. The DataMember property is not necessary in this context as it is used to specify a specific table or list within a data source that contains the data to be bound. The DataTable property is also not required as it is used to directly assign a DataTable object to the GridView control.

Submit
View My Results

Quiz Review Timeline (Updated): Mar 20, 2023 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 20, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Dec 20, 2012
    Quiz Created by
    569461_tcs
Cancel
  • All
    All (30)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
The .NET Framework provides a run time environment called ..... ?
Find the term: The .NET framework provides automatic memory management...
In the body of a method, C# uses the keyword named_____ to refer the...
If one has two different web form controls in a application and wanted...
How many classes can a single .NET DLL contain?
A variable declared inside a method is called a________variable.
Find any errors in the following BankAccount constructor:...
In ASP.NET the < authorization > section contain which of the...
Which method do you invoke on the DataAdapter control to load your...
Which of the following denote ways to manage state in an ASP.Net...
ASP.NET separates the HTML output from program logic using a feature...
Which of the following denote the property in every validation...
The proper way to convert a string to all lowercase is:
If two StringBuilder objects contain the same string then
What tags one need to add within the asp:GridView tags to bind columns...
You are a database developer for Woodgrove Bank. You are implementing...
Polymorphism occurs when the methods of the child class
 In .NET the operation of reading metadata and using its contents...
In ASP.NET the sessions can be dumped by using
You want to execute a DELETE SQL query on a table in the database. You...
Which of the following can be used to add alternating color scheme in...
In order to use the for-each statement, what interface needs to be...
Class String and the Char structure found in the:
You are a database developer for a sales organization. Your database...
What is the top .NET class that everything is derived from?
Which of these statements correctly declares a two-dimensional integer...
Which of the following allow writing formatted output?
What is the base class from which all Web forms inherit?
You use a DataTable to load data from the Orders Table from a...
Which of the following must be done in order to connect data from some...
Alert!

Advertisement