Microsoft .NET Interview Questions

Started by Kalyan, Mar 23, 2008, 05:06 PM

Previous topic - Next topic

Kalyan

Microsoft .NET Interview Questions

What is the base class of .NET?Explain assemblies

Base class provides a base set of methods that all derived classes can use

Explain assemblies

Assemblies are similar to dll files. Both has the reusable pieces of code in the form of classes/ functions. Dll needs to be registered but assemblies have its own metadata.

Assembly is a single deployable unit that contains information about the implementation of classes, structures and interfaces.

It also stores the information about itself called metadata and includes name and version of the assembly, security information, information about the dependencies and the list of files that constitute the assembly.
Assembly also contains namespaces. In the .Net Framework, applications are deployed in the form of assemblies.

An assembly is a single deployable unit that contains all the information about the implementation of :
- classes
- structures and
- interfaces

An assembly stores all the information about itself. This information is called METADATA and include the name and the verison number of the assembly, security information, information about the dependencies and a lost of files that constitute the assembly.
All the application developed using the .NET framework are made up of assemblies.
Namespaces are also stored in assemblies

In theMicrosoft .NET framework an assembly is a partially compiled code library for use in deployment, versioning and security. In the Microsoft Windows implementation of .NET, an assembly is a PE (portable executable) file. There are two types, process assemblies (EXE) and library assemblies (DLL).

A process assembly represents a process which will use classes defined in library assemblies. In version 1.1 of the CLR classes can only be exported from library assemblies; in version 2.0 this restriction is relaxed. The compiler will have a switch to determine if the assembly is a process or library and will set a flag in the PE file.

.NET does not use the extension to determine if the file is a process or library. This means that a library may have either .dll or .exe as its extension.

The code in an assembly is partially compiled into CIL, which is then fully compiled into machine language at runtime by the CLR.

An assembly can consist of one or more files.

Code files are called modules. An assembly can contain more than one code module and since it is possible to use different languages to create code modules this means that it is technically possible to use several different languages to create an assembly.

In practice this rarely happens, principally because Visual Studio only allows developers to create assemblies that consist of a single code module.

Name some of the languages .NET support?

Some of the languages that are supported by .NET

1. Visual Basic.NET
2. Visual C#
3. Visual C++

ADO.NET features? Benefits? Drawbacks?

1. Data will be retrieved through Datasets
2. Scalability

1. Disconnected Data Architecture
2. Data cached in Datasets
3. Data transfer in XML format
4. Interaction with the database is done through data commands

How many types of exception handlers are there in .NET?

From
MSDN >gt; "How the Runtime Manages Exceptions"

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconexceptionsoverview.asp

The exception information table represents four types of exception handlers for protected blocks:

A finally handler that executes whenever the block exits, whether that occurs by normal control flow or by an un handled exception.

A fault handler that must execute if an exception occurs, but does not execute on completion of normal control flow.

A type-filtered handler that handles any exception of a specified class or any of its derived classes.

A user-filtered handler that runs user-specified code to determine whether the exception should be handled by the associated handler or should be passed to the next protected block.

1. Unstructured Exception Handling
2. Structured Exception Handling

Difference between Panel and group box classes?

Panel and Group box both can used as container for other controls like radio buttons and check box.
the difference in panel and group box are Panel
1) In case of panel captions cannot be displayed
2) Can have scroll bars.

Group box
1) Captions can be displayed.
2) Cannot have a scroll bar

Panel is scrollable. In panel you can't set caption like Group box.

What is the base class of Button control?

Listing from visual studio .net > Button Class
System.Object
System.MarshalByRefObject
System.ComponentModel.Component
System.Windows.Forms.Control
System.Windows.Forms.ButtonBase
System.Windows.Forms.Button

What is Response object? How is it related to ASP's Response object?

Response object allows the server to communicate with the client(browser). It is useful for displaying information to the user (or) redirecting the client.

Eg: Response.Write("Hello World")