visual_programming_viva
visual_programming_viva
The Just-In-Time (JIT) compiler in .NET is responsible for converting Intermediate Language (IL) code into
native machine code at runtime. This improves performance by compiling code just before execution,
allowing for optimizations based on the target machine's architecture.
Key Roles of JIT in .NET:
1. Performance Optimization: Uses various techniques like method inlining and code caching to
enhance execution speed.
Q2: What is the purpose of the Common Type System (CTS) in .NET?
The Common Type System (CTS) in .NET defines a standard set of data types and rules that all .NET
languages must follow.
Purpose of CTS in .NET:
1. Ensures Type Safety: Prevents type mismatches between different languages.
2. Supports Language Interoperability: Allows different .NET languages to use and share types
without conflict.
3. Improves Code Reusability: Developers can use types across multiple languages in a .NET project.
Q3: Discuss the role of the Garbage Collector in .NET.
Role of Garbage Collector in .NET:
1. Automatic Memory Management: Frees memory occupied by objects that are no longer in use.
2. Prevents Memory Leaks: Ensures efficient memory utilization by reclaiming unused objects.
3. Manages Object Lifecycle: Identifies and removes objects that are no longer referenced.
4. Optimizes Performance: Runs in the background and deallocates memory, reducing manual
memory management overhead.
Q4: Describe the purpose of the SqlCommand class in ADO.NET.
The SqlCommand class in ADO.NET is used to execute SQL queries, stored procedures, or commands
against a SQL Server database. It is part of the System.Data.SqlClient namespace and is essential for
interacting with databases in .NET applications.
Purpose of SqlCommand in ADO.NET:
1. Execute Stored Procedures: Calls stored procedures using parameters.
2. Retrieve Data: Works with ExecuteReader() to fetch multiple rows.
3. Modify Data: Uses ExecuteNonQuery() for INSERT, UPDATE, DELETE operations.
4. Return Single Values: Uses ExecuteScalar() to return a single value (e.g., count, sum).
Q5: Explain the role of the Try, Catch, and Finally blocks in handling exceptions in VB.NET.
In VB.NET, the Try, Catch, and Finally blocks are used for exception handling, allowing the program to
handle runtime errors gracefully without crashing.
Role of Try, Catch, and Finally Blocks:
1. Try Block:
o Contains the code that might throw an exception.
o If an error occurs, control is passed to the Catch block.
2. Catch Block:
o Handles the exception and prevents the program from crashing.
o Can define multiple Catch blocks for different exceptions.
3. Finally Block:
o Executes regardless of whether an exception occurred or not.
o Used for cleanup operations like closing files or database connections.