Explore topic-wise InterviewSolutions in Current Affairs.

This section includes 7 InterviewSolutions, each offering curated multiple-choice questions to sharpen your Current Affairs knowledge and support exam preparation. Choose a topic below to get started.

1.

What Is Pinvoke?

Answer»

Platform invoke is a SERVICE that enables managed code to call unmanaged functions IMPLEMENTED in dynamic-link libraries (DLLs), such as those in the Win32 API. It locates and invokes an exported function and marshals its arguments (integers, STRINGS, ARRAYS, structures, and so on) across the interoperation boundary as needed.

Platform invoke is a service that enables managed code to call unmanaged functions implemented in dynamic-link libraries (DLLs), such as those in the Win32 API. It locates and invokes an exported function and marshals its arguments (integers, strings, arrays, structures, and so on) across the interoperation boundary as needed.

2.

How Will You Register Com+ Services?

Answer»

The .NET Framework SDK provides the .NET Framework Services INSTALLATION Tool (Regsvcs.exe - a command-line tool) to manually REGISTER an assembly containing serviced components. You can also access these REGISTRATION FEATURES programmatically with the System.EnterpriseServices RegistrationHelper class by creating an instance of class RegistrationHelper and USING the method InstallAssembly.

The .NET Framework SDK provides the .NET Framework Services Installation Tool (Regsvcs.exe - a command-line tool) to manually register an assembly containing serviced components. You can also access these registration features programmatically with the System.EnterpriseServices RegistrationHelper class by creating an instance of class RegistrationHelper and using the method InstallAssembly.

3.

What Is Ccw (com Callable Wrapper)

Answer»

A proxy object GENERATED by the common LANGUAGE runtime so that existing COM applications can use managed classes, including .NET Framework classes, TRANSPARENTLY.

A proxy object generated by the common language runtime so that existing COM applications can use managed classes, including .NET Framework classes, transparently.

4.

What Is Rcw (runtime Callable Wrappers)?

Answer»

The COMMON language RUNTIME exposes COM objects through a proxy CALLED the runtime callable wrapper (RCW). ALTHOUGH the RCW appears to be an ordinary object to .NET clients, its primary function is to MARSHAL calls between a .NET client and a COM object.

The common language runtime exposes COM objects through a proxy called the runtime callable wrapper (RCW). Although the RCW appears to be an ordinary object to .NET clients, its primary function is to marshal calls between a .NET client and a COM object.

5.

What Are Namespaces?

Answer»

The NAMESPACE KEYWORD is used to DECLARE a scope. This namespace scope lets you organize code and gives you a WAY to create globally-unique types. Even if you do not explicitly declare one, a default namespace is created. This unnamed namespace, sometimes called the global namespace,is present in every file.Any identifier in the global namespace is available for use in a named namespace. Namespaces implicitly have public access and this is not modifiable.

The namespace keyword is used to declare a scope. This namespace scope lets you organize code and gives you a way to create globally-unique types. Even if you do not explicitly declare one, a default namespace is created. This unnamed namespace, sometimes called the global namespace,is present in every file.Any identifier in the global namespace is available for use in a named namespace. Namespaces implicitly have public access and this is not modifiable.

6.

What Is Nmake Tool?

Answer»

The Nmake tool (Nmake.exe) is a 32-bit tool that you use to build PROJECTS BASED on COMMANDS contained in a .mak FILE.
usage : nmake -a all

The Nmake tool (Nmake.exe) is a 32-bit tool that you use to build projects based on commands contained in a .mak file.
usage : nmake -a all

7.

Why Do We Need To Call Cg.supressfinalize?

Answer»

Requests that the system not call the finalizer method for the specified OBJECT.
public static void SuppressFinalize( object obj );

The method removes obj from the set of objects that require finalization.
The obj PARAMETER is required to be the caller of this method.

Objects that implement the IDisposable interface can call this method from the IDisposable.Dispose method to prevent the garbage COLLECTOR from CALLING Object.Finalize on an object that does not require it.

Requests that the system not call the finalizer method for the specified object.
public static void SuppressFinalize( object obj );

The method removes obj from the set of objects that require finalization.
The obj parameter is required to be the caller of this method.

Objects that implement the IDisposable interface can call this method from the IDisposable.Dispose method to prevent the garbage collector from calling Object.Finalize on an object that does not require it.

8.

How Garbage Collector (gc) Works?

Answer»

The methods in this class influence when an object is garbage collected and when resources allocated by an object are released. Properties in this class provide information about the total amount of memory AVAILABLE in the system and the age category, or generation, of memory allocated to an object. Periodically, the garbage collector performs garbage collection to reclaim memory allocated to OBJECTS for which there are no valid references. Garbage collection happens AUTOMATICALLY when a request for memory cannot be satisfied using available free memory. Alternatively, an application can force garbage collection using the COLLECT method.

Garbage collection consists of the FOLLOWING steps:
The garbage collector searches for managed objects that are referenced in managed code.
The garbage collector attempts to finalize objects that are not referenced.
The garbage collector frees objects that are not referenced and reclaims their memory.

The methods in this class influence when an object is garbage collected and when resources allocated by an object are released. Properties in this class provide information about the total amount of memory available in the system and the age category, or generation, of memory allocated to an object. Periodically, the garbage collector performs garbage collection to reclaim memory allocated to objects for which there are no valid references. Garbage collection happens automatically when a request for memory cannot be satisfied using available free memory. Alternatively, an application can force garbage collection using the Collect method.

Garbage collection consists of the following steps:
The garbage collector searches for managed objects that are referenced in managed code.
The garbage collector attempts to finalize objects that are not referenced.
The garbage collector frees objects that are not referenced and reclaims their memory.

9.

What Is Active Directory? What Is The Namespace Used To Access The Microsoft Active Directories? What Are Adsi Directories?

Answer»

Active Directory Service Interfaces (ADSI) is a programmatic interface for Microsoft Windows Active Directory. It enables your APPLICATIONS to interact with diverse directories on a NETWORK, using a single interface. Visual Studio .NET and the .NET Framework make it easy to add ADSI FUNCTIONALITY with the DirectoryEntry and DirectorySearcher components. Using ADSI, you can create applications that perform common administrative tasks, such as backing up databases, accessing printers, and administering user accounts. ADSI makes it possible for you to:

Log on once to work with diverse directories. The Directory Entry component class provides username and password properties that can be entered at runtime and communicated to the Active Directory object you are BINDING to. Use a single application programming interface (API) to perform tasks on multiple directory SYSTEMS by offering the user a variety of protocols to use. The DirectoryServices namespace provides the classes to perform most administrative functions.

Perform "rich querying" on directory systems. ADSI technology allows for searching for an object by specifying two query dialects: SQL and LDAP. Access and use a single, hierarchical structure for administering and maintaining diverse and complicated network configurations by accessing an Active Directory tree.

Integrate directory information with databases such as SQL Server. The DirectoryEntry path may be used as an ADO.NET connection string provided that it is using the LDAP provider using System.DirectoryServices;

Active Directory Service Interfaces (ADSI) is a programmatic interface for Microsoft Windows Active Directory. It enables your applications to interact with diverse directories on a network, using a single interface. Visual Studio .NET and the .NET Framework make it easy to add ADSI functionality with the DirectoryEntry and DirectorySearcher components. Using ADSI, you can create applications that perform common administrative tasks, such as backing up databases, accessing printers, and administering user accounts. ADSI makes it possible for you to:

Log on once to work with diverse directories. The Directory Entry component class provides username and password properties that can be entered at runtime and communicated to the Active Directory object you are binding to. Use a single application programming interface (API) to perform tasks on multiple directory systems by offering the user a variety of protocols to use. The DirectoryServices namespace provides the classes to perform most administrative functions.

Perform "rich querying" on directory systems. ADSI technology allows for searching for an object by specifying two query dialects: SQL and LDAP. Access and use a single, hierarchical structure for administering and maintaining diverse and complicated network configurations by accessing an Active Directory tree.

Integrate directory information with databases such as SQL Server. The DirectoryEntry path may be used as an ADO.NET connection string provided that it is using the LDAP provider using System.DirectoryServices;

10.

Describe The Managed Execution Process?

Answer»

The managed execution process includes the following steps:
Choosing a compiler.

To obtain the benefits PROVIDED by the common language runtime, you must use one or more language compilers that target the runtime.

Compiling your code to Microsoft intermediate language (MSIL).

Compiling translates your source code into MSIL and generates the required metadata.
Compiling MSIL to native code.

At execution time, a just-in-time (JIT) compiler translates the MSIL into native code. During this compilation, code must pass a VERIFICATION process that examines the MSIL and metadata to find out whether the code can be determined to be type safe.

Executing your code.

The common language runtime provides the infrastructure that enables execution to take PLACE as well as a VARIETY of services that can be used during execution.

The managed execution process includes the following steps:
Choosing a compiler.

To obtain the benefits provided by the common language runtime, you must use one or more language compilers that target the runtime.

Compiling your code to Microsoft intermediate language (MSIL).

Compiling translates your source code into MSIL and generates the required metadata.
Compiling MSIL to native code.

At execution time, a just-in-time (JIT) compiler translates the MSIL into native code. During this compilation, code must pass a verification process that examines the MSIL and metadata to find out whether the code can be determined to be type safe.

Executing your code.

The common language runtime provides the infrastructure that enables execution to take place as well as a variety of services that can be used during execution.

11.

Using Directive Vs Using Statement

Answer»

You create an instance in a using statement to ensure that Dispose is called on the object when the using statement is exited. A using statement can be exited EITHER when the end of the using statement is reached or if, for example, an exception is THROWN and control leaves the statement BLOCK before the end of the statement.

The using directive has two uses:

Create an alias for a NAMESPACE (a using alias).

Permit the use of types in a namespace, such that, you do not have to QUALIFY the use of a type in that namespace (a using directive).

You create an instance in a using statement to ensure that Dispose is called on the object when the using statement is exited. A using statement can be exited either when the end of the using statement is reached or if, for example, an exception is thrown and control leaves the statement block before the end of the statement.

The using directive has two uses:

Create an alias for a namespace (a using alias).

Permit the use of types in a namespace, such that, you do not have to qualify the use of a type in that namespace (a using directive).

12.

How Do You Create Threading In .net? What Is The Namespace For That?

Answer»

**
System.Threading.Thread

**
System.Threading.Thread

13.

What Is Custom Attribute? How To Create? If I'm Having Custom Attribute In An Assembly, How To Say That Name In The Code?

Answer»

The primary steps to properly design custom ATTRIBUTE classes are as follows:
Applying the AttributeUsageAttribute
([AttributeUsage(AttributeTargets.All,
Inherited = false, AllowMultiple = true)])
Declaring the attribute. (class public class MyAttribute : System.Attribute { // .
. . })
Declaring constructors (public MyAttribute(bool myvalue) { this.myvalue =
myvalue; })
Declaring PROPERTIES
public bool MyProperty
{
get {return this.myvalue;}
set {this.myvalue = value;}
}

The following EXAMPLE demonstrates the basic way of using reflection to get access to custom attributes.
class MainClass
{
public static VOID Main()
{
System.Reflection.MemberInfo info = typeof(MyClass);
object[] attributes = info.GetCustomAttributes();
for (int i = 0; i < attributes.Length; i ++)
{
System.Console.WriteLine(attributes[i]);
}
}
}

The primary steps to properly design custom attribute classes are as follows:
Applying the AttributeUsageAttribute
([AttributeUsage(AttributeTargets.All,
Inherited = false, AllowMultiple = true)])
Declaring the attribute. (class public class MyAttribute : System.Attribute { // .
. . })
Declaring constructors (public MyAttribute(bool myvalue) { this.myvalue =
myvalue; })
Declaring properties
public bool MyProperty
{
get {return this.myvalue;}
set {this.myvalue = value;}
}

The following example demonstrates the basic way of using reflection to get access to custom attributes.
class MainClass
{
public static void Main()
{
System.Reflection.MemberInfo info = typeof(MyClass);
object[] attributes = info.GetCustomAttributes();
for (int i = 0; i < attributes.Length; i ++)
{
System.Console.WriteLine(attributes[i]);
}
}
}

14.

What Is Reflection In .net? Namespace? How Will You Load An Assembly Which Is Not Referenced By Current Assembly?

Answer»

All .NET compilers produce metadata about the types DEFINED in the modules they produce. This metadata is packaged along with the module (modules in TURN are packaged together in assemblies), and can be accessed by a MECHANISM called reflection. The System. Reflection namespace contains classes that can be used to interrogate the types for a module/assembly. Using reflection to access .NET metadata is very similar to using ITypeLib/ITypeInfo to access type library data in COM, and it is used for similar purposes - e.g. DETERMINING data type sizes for marshaling data across context/process/machine boundaries.

Reflection can also be used to dynamically invoke methods (see System.Type.InvokeMember), or even CREATE types dynamically at run-time (see System.Reflection.Emit.TypeBuilder).

All .NET compilers produce metadata about the types defined in the modules they produce. This metadata is packaged along with the module (modules in turn are packaged together in assemblies), and can be accessed by a mechanism called reflection. The System. Reflection namespace contains classes that can be used to interrogate the types for a module/assembly. Using reflection to access .NET metadata is very similar to using ITypeLib/ITypeInfo to access type library data in COM, and it is used for similar purposes - e.g. determining data type sizes for marshaling data across context/process/machine boundaries.

Reflection can also be used to dynamically invoke methods (see System.Type.InvokeMember), or even create types dynamically at run-time (see System.Reflection.Emit.TypeBuilder).

15.

Readonly Vs. Const?

Answer»

A const field can only be initialized at the declaration of the field. A readonly field can be initialized either at the declaration or in a CONSTRUCTOR.Therefore,readonly FIELDS can have different values depending on the constructor used. Also, while a const field is a compile-time constant, the readonly field can be used for runtime CONSTANTS, as in the following example:

PUBLIC static readonly UINT l1 = (uint) DateTime.Now.Ticks;

A const field can only be initialized at the declaration of the field. A readonly field can be initialized either at the declaration or in a constructor.Therefore,readonly fields can have different values depending on the constructor used. Also, while a const field is a compile-time constant, the readonly field can be used for runtime constants, as in the following example:

public static readonly uint l1 = (uint) DateTime.Now.Ticks;

16.

What Is Garbage Collection In .net? Garbage Collection Process?

Answer»

The process of TRANSITIVELY TRACING through all pointers to actively used objects in order to locate all objects that can be referenced, and then arranging to reuse any heap memory that was not found during this trace. The common language RUNTIME garbage COLLECTOR also compacts the memory that is in use to reduce the working space NEEDED for the heap.

The process of transitively tracing through all pointers to actively used objects in order to locate all objects that can be referenced, and then arranging to reuse any heap memory that was not found during this trace. The common language runtime garbage collector also compacts the memory that is in use to reduce the working space needed for the heap.

17.

How To Find Methods Of A Assembly File (not Using Ildasm)

Answer»

Reflection

Reflection

18.

What Is Global Assembly Cache (gac) And What Is The Purpose Of It? (how To Make An Assembly To Public? Steps) How More Than One Version Of An Assembly Can Keep In Same Place?

Answer»

Each computer where the COMMON language runtime is installed has a machine-wide code cache called the global assembly cache. The global assembly cache stores assemblies specifically designated to be shared by several applications on the computer. You should share assemblies by installing them into the global assembly cache only when you need to.
Steps
- CREATE a strong NAME using sn.exe tool
eg: sn -K keyPair.snk
- with in AssemblyInfo.cs add the generated file name
eg: [assembly: AssemblyKeyFile("abc.snk")]
- recompile project, then INSTALL it to GAC by either
drag & drop it to assembly folder (C:\WINDOWS\assembly OR
C:\WINNT\assembly) (shfusion.dll tool)
or
gacutil -i abc.dll

Each computer where the common language runtime is installed has a machine-wide code cache called the global assembly cache. The global assembly cache stores assemblies specifically designated to be shared by several applications on the computer. You should share assemblies by installing them into the global assembly cache only when you need to.
Steps
- Create a strong name using sn.exe tool
eg: sn -k keyPair.snk
- with in AssemblyInfo.cs add the generated file name
eg: [assembly: AssemblyKeyFile("abc.snk")]
- recompile project, then install it to GAC by either
drag & drop it to assembly folder (C:\WINDOWS\assembly OR
C:\WINNT\assembly) (shfusion.dll tool)
or
gacutil -i abc.dll

19.

Difference Between Assembly Manifest &amp; Metadata?

Answer»

assembly self-describing. The assembly manifest contains the assembly's metadata. The manifest establishes the assembly identity, specifies the FILES that make up the assembly implementation, specifies the types and resources that make up the assembly, itemizes the compile-time dependencies on other ASSEMBLIES, and specifies the set of PERMISSIONS required for the assembly to run PROPERLY. This information is used at run time to resolve references, enforce version binding policy, and validate the integrity of loaded assemblies. The self-describing nature of assemblies also helps makes zero-impact install and XCOPY deployment feasible.

metadata - Information that describes every element managed by the common language runtime: an assembly, loadable file, type, method, and so on. This can include information required for debugging and garbage collection, as well as security attributes, marshaling data, EXTENDED class and member definitions, version binding, and other information required by the runtime.

assembly self-describing. The assembly manifest contains the assembly's metadata. The manifest establishes the assembly identity, specifies the files that make up the assembly implementation, specifies the types and resources that make up the assembly, itemizes the compile-time dependencies on other assemblies, and specifies the set of permissions required for the assembly to run properly. This information is used at run time to resolve references, enforce version binding policy, and validate the integrity of loaded assemblies. The self-describing nature of assemblies also helps makes zero-impact install and XCOPY deployment feasible.

metadata - Information that describes every element managed by the common language runtime: an assembly, loadable file, type, method, and so on. This can include information required for debugging and garbage collection, as well as security attributes, marshaling data, extended class and member definitions, version binding, and other information required by the runtime.

20.

What Is Assembly Manifest? What All Details The Assembly Manifest Will Contain?

Answer»

Every assembly, WHETHER static or dynamic, contains a collection of DATA that describes how the elements in the assembly relate to each other. The assembly manifest contains this assembly METADATA. An assembly manifest contains all the metadata needed to specify the assembly's VERSION requirements and security identity, and all metadata needed to define the scope of the assembly and resolve references to resources and classes. The assembly manifest can be stored in either a PE file (an .exe or .dll) with Microsoft intermediate LANGUAGE (MSIL) code or in a standalone PE file that contains only assembly manifest information.

It contains Assembly name, Version number, Culture, Strong name information, List of all files in the assembly, Type reference information, Information on referenced assemblies.

Every assembly, whether static or dynamic, contains a collection of data that describes how the elements in the assembly relate to each other. The assembly manifest contains this assembly metadata. An assembly manifest contains all the metadata needed to specify the assembly's version requirements and security identity, and all metadata needed to define the scope of the assembly and resolve references to resources and classes. The assembly manifest can be stored in either a PE file (an .exe or .dll) with Microsoft intermediate language (MSIL) code or in a standalone PE file that contains only assembly manifest information.

It contains Assembly name, Version number, Culture, Strong name information, List of all files in the assembly, Type reference information, Information on referenced assemblies.

21.

What Is Jagged Arrays?

Answer»

A JAGGED array is an array whose ELEMENTS are arrays. The elements of a jagged array can be of DIFFERENT dimensions and SIZES. A jagged array is sometimes called an "array-of-arrays."

A jagged array is an array whose elements are arrays. The elements of a jagged array can be of different dimensions and sizes. A jagged array is sometimes called an "array-of-arrays."

22.

What Are Satellite Assemblies? How You Will Create This? How Will You Get The Different Language Strings?

Answer»

Satellite assemblies are often used to deploy language-specific resources for an application. These language-specific assemblies work in side-by-side execution because the application has a separate product ID for each language and INSTALLS satellite assemblies in a language-specific subdirectory for each language. When uninstalling, the application removes only the satellite assemblies associated with a given language and .NET Framework VERSION. No CORE .NET Framework files are removed unless the last language for that .NET Framework version is being removed.

(For EXAMPLE, English and Japanese editions of the .NET Framework version 1.1 share the same core files. The Japanese .NET Framework version 1.1 adds satellite assemblies with LOCALIZED resources in a \ja subdirectory. An application that supports the .NET Framework version 1.1, regardless of its language, always uses the same core runtime files.)

Satellite assemblies are often used to deploy language-specific resources for an application. These language-specific assemblies work in side-by-side execution because the application has a separate product ID for each language and installs satellite assemblies in a language-specific subdirectory for each language. When uninstalling, the application removes only the satellite assemblies associated with a given language and .NET Framework version. No core .NET Framework files are removed unless the last language for that .NET Framework version is being removed.

(For example, English and Japanese editions of the .NET Framework version 1.1 share the same core files. The Japanese .NET Framework version 1.1 adds satellite assemblies with localized resources in a \ja subdirectory. An application that supports the .NET Framework version 1.1, regardless of its language, always uses the same core runtime files.)

23.

What Are The Different Types Of Assemblies?

Answer»

PRIVATE, Public/Shared, SATELLITE

Private, Public/Shared, Satellite

24.

What Is Exception Handling?

Answer»

When an exception OCCURS, the system searches for the nearest catch clause that can handle the exception, as determined by the run-time TYPE of the exception. First, the current method is searched for a lexically enclosing try STATEMENT, and the associated catch clauses of the try statement are considered in order. If that fails, the method that called the current method is searched for a lexically enclosing try statement that encloses the point of the call to the current method. This search continues until a catch clause is found that can handle the current exception, by naming an exception class that is of the same class, or a base class, of the run-time type of the exception being thrown. A catch clause that doesn't NAME an exception class can handle any exception.

Once a matching catch clause is found, the system PREPARES to transfer control to the first statement of the catch clause. Before execution of the catch clause begins, the system first executes, in order, any finally clauses that were associated with try statements more nested that than the one that caught the exception.

Exceptions that occur during destructor execution are worth special mention. If an exception occurs during destructor execution, and that exception is not caught, then the execution of that destructor is terminated and the destructor of the base class (if any) is called. If there is no base class (as in the case of the object type) or if there is no base class destructor, then the exception is discarded.

When an exception occurs, the system searches for the nearest catch clause that can handle the exception, as determined by the run-time type of the exception. First, the current method is searched for a lexically enclosing try statement, and the associated catch clauses of the try statement are considered in order. If that fails, the method that called the current method is searched for a lexically enclosing try statement that encloses the point of the call to the current method. This search continues until a catch clause is found that can handle the current exception, by naming an exception class that is of the same class, or a base class, of the run-time type of the exception being thrown. A catch clause that doesn't name an exception class can handle any exception.

Once a matching catch clause is found, the system prepares to transfer control to the first statement of the catch clause. Before execution of the catch clause begins, the system first executes, in order, any finally clauses that were associated with try statements more nested that than the one that caught the exception.

Exceptions that occur during destructor execution are worth special mention. If an exception occurs during destructor execution, and that exception is not caught, then the execution of that destructor is terminated and the destructor of the base class (if any) is called. If there is no base class (as in the case of the object type) or if there is no base class destructor, then the exception is discarded.

25.

What Are Server Controls?

Answer»

ASP.NET SERVER controls are COMPONENTS that run on the server and ENCAPSULATE user-interface and other related functionality. They are used in ASP.NET pages and in ASP.NET code-behind classes.

ASP.NET server controls are components that run on the server and encapsulate user-interface and other related functionality. They are used in ASP.NET pages and in ASP.NET code-behind classes.

26.

Interop Services?

Answer»

The COMMON language runtime provides two mechanisms for interoperating with unmanaged CODE:

Platform invoke, which enables managed code to call functions exported from an unmanaged library.
COM interop, which enables managed code to INTERACT with COM objects through INTERFACES.

Both platform invoke and COM interop use interop marshaling to ACCURATELY move method arguments between caller and callee and back, if required.

The common language runtime provides two mechanisms for interoperating with unmanaged code:

Platform invoke, which enables managed code to call functions exported from an unmanaged library.
COM interop, which enables managed code to interact with COM objects through interfaces.

Both platform invoke and COM interop use interop marshaling to accurately move method arguments between caller and callee and back, if required.

27.

What Are Object Pooling And Connection Pooling And Difference? Where Do We Set The Min And Max Pool Size For Connection Pooling?

Answer»

Object POOLING is a COM+ service that enables you to reduce the overhead of creating each object from scratch. When an object is activated, it is pulled from the POOL. When the object is deactivated, it is placed BACK into the pool to await the NEXT request. You can configure object pooling by applying the ObjectPoolingAttribute attribute to a class that derives from the System.EnterpriseServices.ServicedComponent class.

Object pooling lets you control the number of connections you use, as opposed to connection pooling, where you control the maximum number reached. Following are important differences between object pooling and connection pooling:

Creation. When using connection pooling, creation is on the same thread, so if there is nothing in the pool, a connection is created on your behalf. With object pooling, the pool might decide to create a new object. However, if you have already reached your maximum, it instead gives you the next available object. This is crucial behavior when it takes a long time to create an object, but you do not use it for very long.

Enforcement of minimums and maximums. This is not done in connection pooling. The maximum value in object pooling is very important when trying to scale your application. You might need to MULTIPLEX thousands of requests to just a few objects. (TPC/C benchmarks rely on this.)

COM+ object pooling is identical to what is used in .NET Framework managed SQL Client connection pooling. For example, creation is on a different thread and minimums and maximums are enforced.

Object pooling is a COM+ service that enables you to reduce the overhead of creating each object from scratch. When an object is activated, it is pulled from the pool. When the object is deactivated, it is placed back into the pool to await the next request. You can configure object pooling by applying the ObjectPoolingAttribute attribute to a class that derives from the System.EnterpriseServices.ServicedComponent class.

Object pooling lets you control the number of connections you use, as opposed to connection pooling, where you control the maximum number reached. Following are important differences between object pooling and connection pooling:

Creation. When using connection pooling, creation is on the same thread, so if there is nothing in the pool, a connection is created on your behalf. With object pooling, the pool might decide to create a new object. However, if you have already reached your maximum, it instead gives you the next available object. This is crucial behavior when it takes a long time to create an object, but you do not use it for very long.

Enforcement of minimums and maximums. This is not done in connection pooling. The maximum value in object pooling is very important when trying to scale your application. You might need to multiplex thousands of requests to just a few objects. (TPC/C benchmarks rely on this.)

COM+ object pooling is identical to what is used in .NET Framework managed SQL Client connection pooling. For example, creation is on a different thread and minimums and maximums are enforced.

28.

What Is Event - Delegate? Clear Syntax For Writing A Event Delegate

Answer»

The EVENT keyword lets you specify a delegate that will be called upon the occurrence of some "event" in your CODE. The delegate can have one or more associated methods that will be called when your code indicates that the event has occurred. An event in one program can be made available to other programs that target the .NET FRAMEWORK Common Language Runtime.

// keyword_delegate.cs
// delegate declaration
delegate void MyDelegate(int i);
class Program
{
public static void MAIN()
{
TakesADelegate(new MyDelegate(DelegateFunction));
}
public static void TakesADelegate(MyDelegate SomeFunction)
{
SomeFunction(21);
}
public static void DelegateFunction(int i)
{
System.Console.WriteLine("Called by delegate with number: {0}.", i);
}
}

The event keyword lets you specify a delegate that will be called upon the occurrence of some "event" in your code. The delegate can have one or more associated methods that will be called when your code indicates that the event has occurred. An event in one program can be made available to other programs that target the .NET Framework Common Language Runtime.

// keyword_delegate.cs
// delegate declaration
delegate void MyDelegate(int i);
class Program
{
public static void Main()
{
TakesADelegate(new MyDelegate(DelegateFunction));
}
public static void TakesADelegate(MyDelegate SomeFunction)
{
SomeFunction(21);
}
public static void DelegateFunction(int i)
{
System.Console.WriteLine("Called by delegate with number: {0}.", i);
}
}

29.

Which Namespace Is The Base Class For .net Class Library?

Answer»

system.object

system.object

30.

What Is Jit (just In Time)? How It Works?

Answer»

Before Microsoft intermediate language (MSIL) can be executed, it must be converted by a .NET Framework just-in-time (JIT) compiler to native code, which is CPU-specific code that runs on the same computer architecture as the JIT compiler.

Rather than using time and memory to convert all the MSIL in a portable executable (PE) file to native code, it converts the MSIL as it is needed during execution and stores the resulting native code so that it is accessible for subsequent calls.

The runtime supplies another mode of compilation CALLED install-time code generation. The install-time code generation mode converts MSIL to native code just as the regular JIT compiler does, but it converts larger units of code at a time, storing the resulting native code for use when the assembly is subsequently loaded and executed.

As part of compiling MSIL to native code, code must pass a verification process unless an administrator has ESTABLISHED a SECURITY policy that ALLOWS code to bypass verification. Verification examines MSIL and metadata to find out whether the code can be determined to be type safe, which means that it is known to access only the memory locations it is authorized to access.

Before Microsoft intermediate language (MSIL) can be executed, it must be converted by a .NET Framework just-in-time (JIT) compiler to native code, which is CPU-specific code that runs on the same computer architecture as the JIT compiler.

Rather than using time and memory to convert all the MSIL in a portable executable (PE) file to native code, it converts the MSIL as it is needed during execution and stores the resulting native code so that it is accessible for subsequent calls.

The runtime supplies another mode of compilation called install-time code generation. The install-time code generation mode converts MSIL to native code just as the regular JIT compiler does, but it converts larger units of code at a time, storing the resulting native code for use when the assembly is subsequently loaded and executed.

As part of compiling MSIL to native code, code must pass a verification process unless an administrator has established a security policy that allows code to bypass verification. Verification examines MSIL and metadata to find out whether the code can be determined to be type safe, which means that it is known to access only the memory locations it is authorized to access.

31.

Can I Write Il Programs Directly?

Answer»

Yes. Peter Drayton POSTED this simple EXAMPLE to the DOTNET mailing list:
.assembly MyAssembly {}
.class MyApp {
.method static void Main() {
.entrypoint
ldstr "Hello, IL!"
call void System.Console::WriteLine(class System.Object)
ret
}
}
Just put this into a file called hello.il, and then RUN ilasm hello.il. An EXE assembly will be generated.

Yes. Peter Drayton posted this simple example to the DOTNET mailing list:
.assembly MyAssembly {}
.class MyApp {
.method static void Main() {
.entrypoint
ldstr "Hello, IL!"
call void System.Console::WriteLine(class System.Object)
ret
}
}
Just put this into a file called hello.il, and then run ilasm hello.il. An exe assembly will be generated.

32.

What Is Msil, Il?

Answer»

When compiling to managed code, the compiler translates your source code into Microsoft intermediate language (MSIL), which is a CPU-independent set of instructions that can be EFFICIENTLY converted to native code. MSIL includes instructions for loading, STORING, initializing, and calling methods on OBJECTS, as well as instructions for arithmetic and logical operations, control flow, direct memory access, EXCEPTION handling, and other operations. Microsoft intermediate language (MSIL) is a language used as the output of a number of compilers and as the input to a just-in-time (JIT) compiler. The common language runtime includes a JIT compiler for converting MSIL to native code.

When compiling to managed code, the compiler translates your source code into Microsoft intermediate language (MSIL), which is a CPU-independent set of instructions that can be efficiently converted to native code. MSIL includes instructions for loading, storing, initializing, and calling methods on objects, as well as instructions for arithmetic and logical operations, control flow, direct memory access, exception handling, and other operations. Microsoft intermediate language (MSIL) is a language used as the output of a number of compilers and as the input to a just-in-time (JIT) compiler. The common language runtime includes a JIT compiler for converting MSIL to native code.

33.

I Can't Be Bothered With All This Cas Stuff. Can I Turn It Off?

Answer»

YES, as LONG as you are an ADMINISTRATOR. Just RUN:
CASPOL -s off

Yes, as long as you are an administrator. Just run:
caspol -s off

34.

I'm Having Some Trouble With Cas. How Can I Diagnose My Problem?

Answer»

CASPOL has a couple of OPTIONS that might help. First, you can ask caspol to tell you what code GROUP an ASSEMBLY belongs to, using caspol -rsg. Similarly, you can ask what permissions are being applied to a particular assembly using caspol -rsp.

Caspol has a couple of options that might help. First, you can ask caspol to tell you what code group an assembly belongs to, using caspol -rsg. Similarly, you can ask what permissions are being applied to a particular assembly using caspol -rsp.

35.

What Are The New Features Of Framework 1.1 ?

Answer»

1. Native Support for Developing MOBILE Web Applications

2. Enable Execution of Windows Forms Assemblies Originating from the Internet Assemblies originating from the Internet zone for example, Microsoft Windows Forms controls embedded in an Internet-based Web page or Windows Forms assemblies hosted on an Internet Web server and loaded either through the Web browser or programmatically using the System.Reflection.Assembly.LoadFrom() method now receive sufficient permission to execute in a semi-trusted manner. Default security policy has been changed so that assemblies assigned by the common language runtime (CLR) to the Internet zone code group now receive the constrained permissions associated with the Internet permission set. In the .NET Framework 1.0 Service Pack 1 and Service Pack 2, such applications received the permissions associated with the Nothing permission set and could not execute.

3. Enable Code Access Security for ASP.NET Applications Systems administrators can now use code access security to further lock down the permissions granted to ASP.NET Web applications and Web services. Although the operating system account under which an application RUNS imposes security restrictions on the application, the code access security system of the CLR can enforce additional restrictions on selected application resources based on policies specified by systems administrators. You can use this feature in a shared server environment (such as an Internet service provider (ISP) hosting multiple Web applications on one server) to isolate separate applications from one another, as well as with stand-alone servers where you want applications to run with the minimum necessary privileges.

4. Native Support for Communicating with ODBC and Oracle Databases

5. Unified Programming Model for Smart Client Application Development The Microsoft .NET Compact Framework brings the CLR, Windows Forms controls, and other .NET Framework features to small devices. The .NET Compact Framework supports a large subset of the .NET Framework class LIBRARY optimized for small devices.

6. Support for IPv6
The .NET Framework 1.1 supports the emerging update to the Internet Protocol, commonly referred to as IP version 6, or simply IPv6. This protocol is designed to significantly increase the address space used to identify communication endpoints in the Internet to accommodate its ongoing growth.

1. Native Support for Developing Mobile Web Applications

2. Enable Execution of Windows Forms Assemblies Originating from the Internet Assemblies originating from the Internet zone for example, Microsoft Windows Forms controls embedded in an Internet-based Web page or Windows Forms assemblies hosted on an Internet Web server and loaded either through the Web browser or programmatically using the System.Reflection.Assembly.LoadFrom() method now receive sufficient permission to execute in a semi-trusted manner. Default security policy has been changed so that assemblies assigned by the common language runtime (CLR) to the Internet zone code group now receive the constrained permissions associated with the Internet permission set. In the .NET Framework 1.0 Service Pack 1 and Service Pack 2, such applications received the permissions associated with the Nothing permission set and could not execute.

3. Enable Code Access Security for ASP.NET Applications Systems administrators can now use code access security to further lock down the permissions granted to ASP.NET Web applications and Web services. Although the operating system account under which an application runs imposes security restrictions on the application, the code access security system of the CLR can enforce additional restrictions on selected application resources based on policies specified by systems administrators. You can use this feature in a shared server environment (such as an Internet service provider (ISP) hosting multiple Web applications on one server) to isolate separate applications from one another, as well as with stand-alone servers where you want applications to run with the minimum necessary privileges.

4. Native Support for Communicating with ODBC and Oracle Databases

5. Unified Programming Model for Smart Client Application Development The Microsoft .NET Compact Framework brings the CLR, Windows Forms controls, and other .NET Framework features to small devices. The .NET Compact Framework supports a large subset of the .NET Framework class library optimized for small devices.

6. Support for IPv6
The .NET Framework 1.1 supports the emerging update to the Internet Protocol, commonly referred to as IP version 6, or simply IPv6. This protocol is designed to significantly increase the address space used to identify communication endpoints in the Internet to accommodate its ongoing growth.

36.

Is .net A Runtime Service Or A Development Platform?

Answer»

It's both and actually a lot more. MICROSOFT .NET includes a new way of delivering software and services to businesses and consumers. A part of Microsoft.NET is the .NET Frameworks. The .NET frameworks SDK consists of two parts: the .NET common language runtime and the .NET CLASS library. In addition, the SDK also includes command-line compilers for C#, C++, JScript, and VB. You use these compilers to build applications and components. These components require the runtime to execute so this is a development PLATFORM.

 

It's both and actually a lot more. Microsoft .NET includes a new way of delivering software and services to businesses and consumers. A part of Microsoft.NET is the .NET Frameworks. The .NET frameworks SDK consists of two parts: the .NET common language runtime and the .NET class library. In addition, the SDK also includes command-line compilers for C#, C++, JScript, and VB. You use these compilers to build applications and components. These components require the runtime to execute so this is a development platform.

 

37.

What Is .net Framework?

Answer»

The .NET Framework has two main components: the common language runtime and the .NET Framework class library.

You can think of the runtime as an agent that manages code at execution time,providing core services such as memory MANAGEMENT, thread management, and remoting, while also enforcing strict type safety and other forms of code ACCURACY that ENSURE security and robustness.

The class library, is a comprehensive, object-oriented collection of reusable types that you can use to develop applications ranging from traditional command-line or graphical user interface (GUI) applications to applications based on the latest INNOVATIONS provided by ASP.NET, such as Web Forms and XML Web services.

The .NET Framework has two main components: the common language runtime and the .NET Framework class library.

You can think of the runtime as an agent that manages code at execution time,providing core services such as memory management, thread management, and remoting, while also enforcing strict type safety and other forms of code accuracy that ensure security and robustness.

The class library, is a comprehensive, object-oriented collection of reusable types that you can use to develop applications ranging from traditional command-line or graphical user interface (GUI) applications to applications based on the latest innovations provided by ASP.NET, such as Web Forms and XML Web services.

38.

What Are Advantages And Disadvantages Of Microsoft-provided Data Provider Classes In Ado.net?

Answer»

SQLServer.NET DATA provider is high-speed and robust, but requires SQL Server license purchased from Microsoft. OLE-DB.NET is universal for accessing other sources, like ORACLE, DB2, Microsoft Access and Informix. OLE-DB.NET is a .NET layer on TOP of the OLE layer, so it’s not as fastest and efficient as SqlServer.NET.

SQLServer.NET data provider is high-speed and robust, but requires SQL Server license purchased from Microsoft. OLE-DB.NET is universal for accessing other sources, like Oracle, DB2, Microsoft Access and Informix. OLE-DB.NET is a .NET layer on top of the OLE layer, so it’s not as fastest and efficient as SqlServer.NET.

39.

How Is Method Overriding Different From Method Overloading?

Answer»

When overriding a method, you CHANGE the behavior of the method for the DERIVED class. Overloading a method simply involves having ANOTHER method with the same NAME WITHIN the class.

When overriding a method, you change the behavior of the method for the derived class. Overloading a method simply involves having another method with the same name within the class.

40.

Can You Prevent Your Class From Being Inherited By Another Class?

Answer»

Yes. The KEYWORDSEALED” will PREVENT the CLASS from being inherited.

Yes. The keyword “sealed” will prevent the class from being inherited.

41.

Define Xmlvalidatingreader Class.

Answer»

The XMLValidatingReader class (Assembly: System.Xml.dll) represents a READER that PROVIDES:
- DOCUMENT type definition (DTD),
- XML-Data REDUCED (XDR) schema, and
- XML Schema definition language (XSD) validation

The XMLValidatingReader class (Assembly: System.Xml.dll) represents a reader that provides:
- Document type definition (DTD),
- XML-Data Reduced (XDR) schema, and
- XML Schema definition language (XSD) validation

42.

Define Xmlreader Class.

Answer»

The XMLReader CLASS (Assembly: System.Xml.dll) represents a READER that provides FAST, non-cached, forward-only access to XML data.

The XMLReader Class (Assembly: System.Xml.dll) represents a reader that provides fast, non-cached, forward-only access to XML data.

43.

What Is Xpath?

Answer»

XPath is a LANGUAGE that is used to NAVIGATE through XML DOCUMENTS.

XPath is a language that is used to navigate through XML documents.

44.

Define Xslt.

Answer»

XSLT is a LANGUAGE for transforming XML DOCUMENTS into XHTML documents or to other XML documents.

XPATH is a language for navigating in XML documents.

XSLT is a language for transforming XML documents into XHTML documents or to other XML documents.

XPath is a language for navigating in XML documents.

45.

Asp.net Caching

Answer»

This INCLUDES CACHING MECHANISM in ASP.NET, its ADVANTAGES and TYPES.

This includes caching mechanism in ASP.NET, its advantages and types.

46.

Asp.net State Management

Answer»

This ARTICLE DESCRIBES STATE MANAGEMENT in ASP.NET. It EXPLAINS client-side state management and server-side state management.

This article describes state management in ASP.NET. It explains client-side state management and server-side state management.

47.

Overview Of Ado.net Architecture.

Answer»

Data Provider provides objects through which functionalities like opening and closing CONNECTION, retrieving and updating data can be availed.

It also provides access to data source like SQL SERVER, Access, and ORACLE).

Some of the data provider objects are:

  • Command object which is used to store procedures.
  • Data Adapter which is a bridge between datastore and dataset.
  • Datareader which reads data from data store in forward only mode.
  • A dataset object is not in directly connected to any data store. It represents disconnected and cached data. The dataset communicates with Data adapter that fills up the dataset. Dataset can have ONE or more Datatable and relations.
  • DataView object is used to sort and filter data in Datatable.

Data Provider provides objects through which functionalities like opening and closing connection, retrieving and updating data can be availed.

It also provides access to data source like SQL Server, Access, and Oracle).

Some of the data provider objects are:

48.

Explain Form Level Validation And Field Level Validation

Answer»

Field-level validation provides IMMEDIATE validation of the input given by the user. The EVENTS associated with field-level validation are KeyDown, KeyPress, textchange, etc.
In form-level validation the validation STEP is done after the FILLING up of the form is done. It’s usually when the user submits the FORMS.

Field-level validation provides immediate validation of the input given by the user. The events associated with field-level validation are KeyDown, KeyPress, textchange, etc.
In form-level validation the validation step is done after the filling up of the form is done. It’s usually when the user submits the forms.

49.

How Is My Content Secured From Unauthorized Access?

Answer»

You will have to be signed into the SilverlightTM Streaming service to manage your account and your SILVERLIGHT applications. Your SilverlightTM Streaming ID and secret key, associated to your Windows Live ID, will AUTHENTICATE you as the unique and legitimate owner of the applications and content you UPLOAD to the service. You will ALSO need this information to manage your Silverlight applications using the API. The SilverlightTM Streaming ID is public. However, the secret key should be KEPT confidential.

You will have to be signed into the SilverlightTM Streaming service to manage your account and your Silverlight applications. Your SilverlightTM Streaming ID and secret key, associated to your Windows Live ID, will authenticate you as the unique and legitimate owner of the applications and content you upload to the service. You will also need this information to manage your Silverlight applications using the API. The SilverlightTM Streaming ID is public. However, the secret key should be kept confidential.

50.

Is Silverlight A New Media Player?

Answer»

No. SILVERLIGHT is a cross-browser, cross-platform plug-in for DELIVERING media EXPERIENCES and RIAs.It is not a DESKTOP application or stand-alone media player.

No. Silverlight is a cross-browser, cross-platform plug-in for delivering media experiences and RIAs.It is not a desktop application or stand-alone media player.