.Net

What are static variables?

Variables that have only one copy per class are known as static variables. They are not attached to a particular instance of a class but rather belong to a class as a whole. They are declared by using the static keyword as a modifier.

               static type  varIdentifier;

where, the name of the variable is varIdentifier and its data type is specified by type. Note: Static variables that are not explicitly initialized in the code are automatically initialized with a default value. The default value depends on the data type of the variables.

What are different ways you can pass data between tiers?

There are many ways you can pass data between tiers :-

?   Dataset the most preferred one as they maintain data in XML format.

?   Datareader

?   Custom classes. ?   XML

What is equivalent for regsvr32 exe in .NET ?

Regasm

What are types of compatibility in VB6?

There are three possible project compatibility settings: ?    No Compatibility

?    Project Compatibility ?    Binary Compatibility

No Compatibility

With this setting, new class ID’s, new interface ID’s and a new type library ID will be generated by VB each time the ActiveX component project is compiled. This will cause any compiled client components to fail (with error 429!) and report a missing reference to the ‘VB ActiveX Test Component’ when a client project is loaded in the VB IDE.

Note :- Use this setting to compile the initial release of a component to other developers.

Project Compatibility

With this setting, VB will generate new interface ID’s More >

How do you do object pooling in .NET ?

COM+ reduces overhead by creating object from scratch. So in COM+ when object is activated its activated from pool and when its deactivated it’s pushed back to the pool. Object pooling is configures by using the “ObjectPoolingAttribute” to the class.

Note:- When a class is marked with objectpooling attribute it can not be inherited.

ObjectPooling(MinPoolSize := 2, MaxPoolSize := 5, CreationTimeout := 20000)> _ Public Class testingclass

Inherits ServicedComponent

Public Sub DoWork()

‘ Method contents go here. End Sub

End Class

Above is a sample code which has the “ObjectPooling” attribute defined. Below is a sample code which uses the class.

Public Class App

Overloads Public Shared Sub Main(args() More >

How many types of Transactions are there in COM + .NET ?

There are 5 transactions types that can be used with COM+. Whenever an object is registered with COM+ it has to abide either to these 5 transaction types.

Disabled: – There is no transaction. COM+ does not provide transaction support for this component.

Not Supported: – Component does not support transactions. Hence even if the calling component in the hierarchy is transaction enabled this component will not participate in the transaction.

Supported: – Components with transaction type support will be a part of the transaction. This will be only if the calling component has an active transaction. If the calling component is not More >

How to implement DTC in .NET ?

DTC is implemented using COM+.

Following are the steps to implement COM + in .NET :-

?       “EnterpriseService” namespace has all the classes by which we can implement DTC

in .NET.  You have to add reference “EnterpriseService” namespace.

How do we create DCOM object in VB6?

Using the CreateObject method you can create a DCOM object. You have to put   the server name in the registry.

Can you explain what is DCOM ?

DCOM differs from COM in that it allows for creating objects distributed across a network, a protocol for invoking that object’s methods, and secures access to the object. DCOM provides a wrapper around COM, hence it is a backwards compatible extension. DCOM uses Remote Procedural Calls (RPC) using  Open Software Foundation’s Distributed Computing Environment.

These RPC are implemented over TCP/IP and named pipes. The protocol which is actually being used is registered just prior to use, as opposed to being registered at initialization time. The reason for this is that if a protocol is not being used, it will not be More >

Can you describe IUKNOWN interface in short ?

Every COM object supports at least one interface, the IUnknown interface. All interfaces are classes derived from the base class IUnknown. Each interface supports methods access data and perform operations transparently to the programmer. For example, IUnknown supports three methods, AddRef, Release(), and QueryInterface(). Suppose that pinterf is a pointer to an IUnknown. pinterf->AddRef() increments the reference count. pinterf->Release() decrements the reference count, deleting the object when the reference count reaches zero. pinterf->QueryInterface( IDesired,pDesired) checks to see if the current interface (IUnknown) supports another interface, IDesired, creates an instance (via a call to CoCreateInstance()) of the object if the reference More >