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 A Web Service?

Answer»

Web Services are business logic components which provide functionality VIA the Internet using standard protocols such as HTTP. Web Services uses Simple OBJECT Access Protocol (SOAP) in order to expose the business functionality.SOAP defines a standardized format in XML which can be exchanged between two entities over standard protocols such as HTTP. SOAP is platform independent so the CONSUMER of a Web Service is therefore completely shielded from any implementation details about the platform exposing the Web Service. For the consumer it is simply a black box of send and receive XML over HTTP. So any web service hosted on WINDOWS can also be consumed by UNIX and LINUX platform.

Web Services are business logic components which provide functionality via the Internet using standard protocols such as HTTP. Web Services uses Simple Object Access Protocol (SOAP) in order to expose the business functionality.SOAP defines a standardized format in XML which can be exchanged between two entities over standard protocols such as HTTP. SOAP is platform independent so the consumer of a Web Service is therefore completely shielded from any implementation details about the platform exposing the Web Service. For the consumer it is simply a black box of send and receive XML over HTTP. So any web service hosted on Windows can also be consumed by UNIX and LINUX platform.

2.

What Is Objref Object In Remoting?

Answer»

All Marshal() METHODS RETURN ObjRef OBJECT.The ObjRef is serializable because it implements the INTERFACE ISerializable, and can be marshaled by value. The ObjRef knows about location of the remote object, host NAME, port number and object name.

All Marshal() methods return ObjRef object.The ObjRef is serializable because it implements the interface ISerializable, and can be marshaled by value. The ObjRef knows about location of the remote object, host name, port number and object name.

3.

What Is Marshalling And What Are Different Kinds Of Marshalling?

Answer»

Marshaling is used when an object is converted so that it can be sent across the network or across application domains. Unmarshaling CREATES an object from the marshaled data. There are TWO ways to do marshalling:

-Marshal-by-value (MBV): In this the object is serialized into the channel, and a copy of the object is CREATED on the other side of the network. The object to marshal is stored into a stream, and the stream is used to build a copy of the object on the other side with the unmarshalling sequence.

-Marshaling-by-reference (MBR): Here it creates a proxy on the client that is used to communicate with the remote object. The marshaling sequence of a remote object creates an ObjRef INSTANCE that itself can be serialized across the network.

Marshaling is used when an object is converted so that it can be sent across the network or across application domains. Unmarshaling creates an object from the marshaled data. There are two ways to do marshalling:

-Marshal-by-value (MBV): In this the object is serialized into the channel, and a copy of the object is created on the other side of the network. The object to marshal is stored into a stream, and the stream is used to build a copy of the object on the other side with the unmarshalling sequence.

-Marshaling-by-reference (MBR): Here it creates a proxy on the client that is used to communicate with the remote object. The marshaling sequence of a remote object creates an ObjRef instance that itself can be serialized across the network.

4.

What Is Asynchronous One-way Calls?

Answer»

One-way calls are a DIFFERENT from asynchronous calls from execution angle that the .NET Framework does not guarantee their execution. In ADDITION, the methods used in this kind of CALL cannot have return values or out PARAMETERS. One-way calls are defined by USING [OneWay()] attribute in class.

One-way calls are a different from asynchronous calls from execution angle that the .NET Framework does not guarantee their execution. In addition, the methods used in this kind of call cannot have return values or out parameters. One-way calls are defined by using [OneWay()] attribute in class.

5.

How Can We Call Methods In Remoting Asynchronously?

Answer»

We can MAKE Asynchronous METHOD CALLS by using DELEGATES.

We can make Asynchronous method calls by using delegates.

6.

Can Non-default Constructors Be Used With Single Call Sao?

Answer»

Non-Default constructors can not be USED with single call objects as object is created with every method call, there is no way to define Non-default constructors in method calls. It’s POSSIBLE to use Non-Default constructor with CLIENT activated objects as both methods "NEW" KEYWORD and "Activator.CreateInstance" provide a way to SPECIFY Non-Default constructors.

Non-Default constructors can not be used with single call objects as object is created with every method call, there is no way to define Non-default constructors in method calls. It’s possible to use Non-Default constructor with Client activated objects as both methods "NEW" keyword and "Activator.CreateInstance" provide a way to specify Non-Default constructors.

7.

Which Config File Has All The Supported Channels/protocol?

Answer»

Machine.config file has all the supported CHANNELS and formatter supported by .NET remoting.Machine.config file can be found at "C:\WINDOWS\Microsoft.NET\Framework\vXXXXX\CONFIG" path. Find ELEMENT in the Machine. config file which has the channels and the formatters. Below is a figure SHOWN which can give a clear idea of how the file looks like.

Machine.config file has all the supported channels and formatter supported by .NET remoting.Machine.config file can be found at "C:\WINDOWS\Microsoft.NET\Framework\vXXXXX\CONFIG" path. Find element in the Machine. config file which has the channels and the formatters. Below is a figure shown which can give a clear idea of how the file looks like.

8.

Is It A Good Design Practice To Distribute The Implementation To Remoting Client?

Answer»

It’s NEVER advisable to distribute complete implementation at client, due to following reasons:
-Any ONE can use ILDASM or similar utility and get access to your code.

-It’s a bad architecture move to have FULL implementation as client side as any CHANGES in implementation on server side you have to redistribute it again.

So the best way is to have a interface or SOAPSUDS generated meta-data DLL at client side rather than having full implementation.

It’s never advisable to distribute complete implementation at client, due to following reasons:
-Any one can use ILDASM or similar utility and get access to your code.

-It’s a bad architecture move to have full implementation as client side as any changes in implementation on server side you have to redistribute it again.

So the best way is to have a interface or SOAPSUDS generated meta-data DLL at client side rather than having full implementation.

9.

Are Cao Stateful In Nature?

Answer»

Yes. In CAO remoting model client CREATES a INSTANCE on server and instance variable SET by client on server can be retrieved again with correct VALUE.

Yes. In CAO remoting model client creates a instance on server and instance variable set by client on server can be retrieved again with correct value.

10.

What Are The Ways In Which Client Can Create Object On Server In Cao Model?

Answer»

There are two ways by which you can CREATE Client OBJECTS on REMOTING server:

  • Activator.CreateInstance()
  • By Keyword "NEW".

There are two ways by which you can create Client objects on remoting server:

11.

What Is Fundamental Of Published Or Precreated Objects In Remoting?

Answer»

In scenarios of singleton or single call the OBJECTS are CREATED dynamically. But in situations where you want to precreate object and publish it you will use published object scenarios.

DIM obj as new objRemote
obj.Initvalue = 100
RemotingServices.Marshal(obj,"RemoteObject")

As shown in above SAMPLE following changes will be needed on server side.

Remoting Configuration.Register WellKnown ServiceType is REPLACED by Remoting Services .Marshal (obj,"Remote Object") where "obj" is the precreated objected on the server whose value is initialized to 100.

In scenarios of singleton or single call the objects are created dynamically. But in situations where you want to precreate object and publish it you will use published object scenarios.

Dim obj as new objRemote
obj.Initvalue = 100
RemotingServices.Marshal(obj,"RemoteObject")

As shown in above sample following changes will be needed on server side.

Remoting Configuration.Register WellKnown ServiceType is replaced by Remoting Services .Marshal (obj,"Remote Object") where "obj" is the precreated objected on the server whose value is initialized to 100.

12.

What Are The Situations You Will Use Singleton Architecture In Remoting ?

Answer»

If all REMOTING clients have to SHARE the same data SINGLETON architecture will be used.

If all remoting clients have to share the same data singleton architecture will be used.

13.

What Are Two Different Types Of Remote Object Creation Mode In .net?

Answer»

There are TWO different ways in which object can be created USING Remoting:

-SAO (Server ACTIVATED Objects) also called as Well-Known call MODE.
-CAO (CLIENT Activated Objects).
SAO has two modes "Single Call" and "Singleton". With Single Call object the object is created with every method call thus making the object stateless. With Singleton the object is created only once and the object is shared with all clients.

CAO are stateful as compared to SAO. In CAO the creation request is sent from client side. Client holds a proxy to the server object created on server.

There are two different ways in which object can be created using Remoting:

-SAO (Server Activated Objects) also called as Well-Known call mode.
-CAO (Client Activated Objects).
SAO has two modes "Single Call" and "Singleton". With Single Call object the object is created with every method call thus making the object stateless. With Singleton the object is created only once and the object is shared with all clients.

CAO are stateful as compared to SAO. In CAO the creation request is sent from client side. Client holds a proxy to the server object created on server.

14.

Which Class Does The Remote Object Has To Inherit?

Answer»

All REMOTE OBJECTS should INHERIT from System.MarshalbyRefObject.

All remote objects should inherit from System.MarshalbyRefObject.

15.

What Do Mean By Remotable Objects In .net Remoting?

Answer»

Remotable objects can be MARSHALED across the APPLICATION domains. You can marshal by value, where a deep copy of the object is CREATED and then PASSED to the receiver. You can also marshal by reference, where just a reference to an existing object is passed.

Remotable objects can be marshaled across the application domains. You can marshal by value, where a deep copy of the object is created and then passed to the receiver. You can also marshal by reference, where just a reference to an existing object is passed.

16.

What Is The Proxy Of The Server Object In .net Remoting?

Answer»

PROXY is COPY of the server OBJECT( a thin layer) that resides on the client SIDE and behaves as if it was the server. It delegate calls to the real server object. This PROCESS is also known as marshaling.

Proxy is copy of the server object( a thin layer) that resides on the client side and behaves as if it was the server. It delegate calls to the real server object. This process is also known as marshaling.

17.

How To Decide Which To Use .net Remoting Or Asp.net Web Services?

Answer»

Remoting is a more EFFICIENT communication exchange when you can control both ENDS of the application involved in the communication process. Remoting is excellent in CASE of intranet applicaton becuase of the speed.

Web SERVICES provide an open-protocol-based exchange of informaion. Web Services are best when you need to ommunicate with an EXTERNAL organization or another (non-.NET) technology applications.

Remoting is a more efficient communication exchange when you can control both ends of the application involved in the communication process. Remoting is excellent in case of intranet applicaton becuase of the speed.

Web Services provide an open-protocol-based exchange of informaion. Web Services are best when you need to ommunicate with an external organization or another (non-.NET) technology applications.

18.

What Is The Relationship Between A Process, Application Domain, And Application?

Answer»

A process is an instance of a running APPLICATION. An application is an executable in the COMPUTER. There can be numerous PROCESSES launched of the same application (5 copies of Word running), but 1 process can RUN just 1 application. Hence, Process is a running instance of the application.

A process is an instance of a running application. An application is an executable in the computer. There can be numerous processes launched of the same application (5 copies of Word running), but 1 process can run just 1 application. Hence, Process is a running instance of the application.

19.

What Do You Mean By A Windows Process In Regards To Memory Allocation?

Answer»

Each process is ALLOCATED its own address space typically 4GB in which it can run. No other process can interfere in that address space.

If the process CRASHES, it dies alone without TAKING the ENTIRE OS or a bunch of other applications down.

Each process is allocated its own address space typically 4GB in which it can run. No other process can interfere in that address space.

If the process crashes, it dies alone without taking the entire OS or a bunch of other applications down.

20.

What's Singlecall Activation Mode Used For?

Answer»

If the SERVER object is instantiated for RESPONDING to just one single request, the request should be MADE in SingleCall mode.

If the server object is instantiated for responding to just one single request, the request should be made in SingleCall mode.

21.

What Are The Consideration In Deciding To Use .net Remoting Or Asp.net Web Services?

Answer»

Remoting is a more efficient communication exchange when you can control both ends of the APPLICATION involved in the communication PROCESS. Web Services provide an open-protocol-based exchange of informaion. Web Services are BEST when you NEED to communicate with an external organization or another (non-.NET) technology.

Remoting is a more efficient communication exchange when you can control both ends of the application involved in the communication process. Web Services provide an open-protocol-based exchange of informaion. Web Services are best when you need to communicate with an external organization or another (non-.NET) technology.

22.

How Can You Automatically Generate Interface For The Remotable Object In .net With Microsoft Tools?

Answer»

USE the Soapsuds TOOL.

Use the Soapsuds tool.

23.

Can You Configure A .net Remoting Object Via Xml File?

Answer»

Yes, via machine.CONFIG and APPLICATION LEVEL .config FILE (or web.config in ASP.NET). Application-level XML settings take PRECEDENCE over machine.config.

Yes, via machine.config and application level .config file (or web.config in ASP.NET). Application-level XML settings take precedence over machine.config.

24.

What's Singleton Activation Mode?

Answer»

A single object is instantiated regardless of the number of clients ACCESSING it. Lifetime of this object is DETERMINED by lifetime LEASE.

A single object is instantiated regardless of the number of clients accessing it. Lifetime of this object is determined by lifetime lease.

25.

What's Singlecall Activation Mode Used For?

Answer»

If the server object is INSTANTIATED for responding to just ONE single request, the request should be MADE in SINGLECALL mode.

If the server object is instantiated for responding to just one single request, the request should be made in SingleCall mode.

26.

What Is A Formatter?

Answer»

A formatter is an object that is RESPONSIBLE for encoding and SERIALIZING DATA into MESSAGES on one end, and deserializing and DECODING messages into data on the other end.

A formatter is an object that is responsible for encoding and serializing data into messages on one end, and deserializing and decoding messages into data on the other end.

27.

What Security Measures Exist For .net Remoting In System.runtime.remoting?

Answer»

NONE. Security should be taken CARE of at the APPLICATION LEVEL. Cryptography and other security techniques can be applied at application or server level.

None. Security should be taken care of at the application level. Cryptography and other security techniques can be applied at application or server level.

28.

What Are Channels In .net Remoting?

Answer»

CHANNELS represent the OBJECTS that transfer the other serialized objects from one application domain to another and from one COMPUTER to another, as WELL as one process to another on the same box. A CHANNEL must exist before an object can be transferred.

Channels represent the objects that transfer the other serialized objects from one application domain to another and from one computer to another, as well as one process to another on the same box. A channel must exist before an object can be transferred.

29.

What's A Proxy Of The Server Object In .net Remoting?

Answer»

It’s a fake copy of the server object that RESIDES on the client side and behaves as if it was the server. It handles the COMMUNICATION between REAL server object and the client object. This PROCESS is also KNOWN as marshaling.

It’s a fake copy of the server object that resides on the client side and behaves as if it was the server. It handles the communication between real server object and the client object. This process is also known as marshaling.

30.

When Would You Use .net Remoting And When Web Services?

Answer»

Use remoting for more EFFICIENT exchange of information when you control both ends of the application. Use Web SERVICES for open-protocol-based information exchange when you are just a client or a SERVER with the other end BELONGING to someone else.

Use remoting for more efficient exchange of information when you control both ends of the application. Use Web services for open-protocol-based information exchange when you are just a client or a server with the other end belonging to someone else.

31.

What Distributed Process Frameworks Outside .net Do You Know?

Answer»

Distributed COMPUTING Environment/Remote Procedure CALLS (DEC/RPC), MICROSOFT Distributed Component Object Model (DCOM), Common Object Request Broker Architecture (CORBA), and Java Remote Method INVOCATION (RMI).

Distributed Computing Environment/Remote Procedure Calls (DEC/RPC), Microsoft Distributed Component Object Model (DCOM), Common Object Request Broker Architecture (CORBA), and Java Remote Method Invocation (RMI).

32.

Why Do You Call It A Process? What's Different Between Process And Application In .net, Not Common Computer Usage, Terminology?

Answer»

A PROCESS is an instance of a RUNNING application. An application is an executable on the hard drive or NETWORK. There can be numerous processes launched of the same application (5 copies of Word running), but 1 process can run just 1 application.

A process is an instance of a running application. An application is an executable on the hard drive or network. There can be numerous processes launched of the same application (5 copies of Word running), but 1 process can run just 1 application.

33.

What's Typical About A Windows Process In Regards To Memory Allocation?

Answer»

Each PROCESS is allocated its own block of AVAILABLE RAM SPACE, no process can access another process code or data. If the process crashes, it DIES alone without taking the ENTIRE OS or a bunch of other applications down.

Each process is allocated its own block of available RAM space, no process can access another process code or data. If the process crashes, it dies alone without taking the entire OS or a bunch of other applications down.

34.

What's A Windows Process?

Answer»

It’s an APPLICATION that’s RUNNING and had been ALLOCATED MEMORY

It’s an application that’s running and had been allocated memory

35.

What Is .net And .net Framework?

Answer»

It is a Framework in which Windows APPLICATIONS may be DEVELOPED and run. The Microsoft .NET Framework is a platform for building, deploying, and running Web Services and applications. It provides a highly productive, standards-based, multi-language environment for integrating existing INVESTMENTS with next-generation applications and services as well as the agility to solve the challenges of deployment and operation of Internet-scale applications. The .NET Framework consists of three main parts: the common language runtime, a hierarchical set of unified class libraries, and a componentized version of Active Server Pages called ASP.NET. The .NET Framework provides a new programming model and rich set of classes designed to simplify application development for Windows, the Web, and mobile devices. It provides full support for XML Web services, contains robust security features, and delivers new levels of programming power. The .NET Framework is used by all Microsoft languages including Visual C#, Visual J#, and Visual C++.

It is a Framework in which Windows applications may be developed and run. The Microsoft .NET Framework is a platform for building, deploying, and running Web Services and applications. It provides a highly productive, standards-based, multi-language environment for integrating existing investments with next-generation applications and services as well as the agility to solve the challenges of deployment and operation of Internet-scale applications. The .NET Framework consists of three main parts: the common language runtime, a hierarchical set of unified class libraries, and a componentized version of Active Server Pages called ASP.NET. The .NET Framework provides a new programming model and rich set of classes designed to simplify application development for Windows, the Web, and mobile devices. It provides full support for XML Web services, contains robust security features, and delivers new levels of programming power. The .NET Framework is used by all Microsoft languages including Visual C#, Visual J#, and Visual C++.

36.

What Is Managed Code And Managed Data In .net?

Answer»

Managed code is code that is written to target the services of the Common Language Runtime.
In order to target these services, the code must PROVIDE a minimum level of information (metadata) to the runtime.All C#, Visual Basic .NET, and JScript .NET code is managed by default. Visual Studio .NET C++ code is not managed by default, but the compiler can produce managed code by specifying a command-line switch (/CLR).Closely related to managed code is managed data--data that is allocated and de-allocated by the Common Language Runtime's garbage collector. C#, Visual Basic, and JScript .NET data is managed by default.C# data can, however, be MARKED as UNMANAGED through the use of special keywords.Visual Studio .NET C++ data is unmanaged by default (even when using the /CLR switch), but when using Managed Extensions for C++, a class can be marked as managed using the __gc keyword. As the name suggests, this means that the MEMORY for instances of the class is managed by the garbage collector.

In addition, the class BECOMES a full participating member of the .NET Framework community, with the benefits and restrictions that it brings. An example of a benefit is proper interoperability with classes written in other languages (for example, a managed C++ class can inherit from a Visual Basic class).An example of a restriction is that a managed class can only inherit from one base class.

Managed code is code that is written to target the services of the Common Language Runtime.
In order to target these services, the code must provide a minimum level of information (metadata) to the runtime.All C#, Visual Basic .NET, and JScript .NET code is managed by default. Visual Studio .NET C++ code is not managed by default, but the compiler can produce managed code by specifying a command-line switch (/CLR).Closely related to managed code is managed data--data that is allocated and de-allocated by the Common Language Runtime's garbage collector. C#, Visual Basic, and JScript .NET data is managed by default.C# data can, however, be marked as unmanaged through the use of special keywords.Visual Studio .NET C++ data is unmanaged by default (even when using the /CLR switch), but when using Managed Extensions for C++, a class can be marked as managed using the __gc keyword. As the name suggests, this means that the memory for instances of the class is managed by the garbage collector.

In addition, the class becomes a full participating member of the .NET Framework community, with the benefits and restrictions that it brings. An example of a benefit is proper interoperability with classes written in other languages (for example, a managed C++ class can inherit from a Visual Basic class).An example of a restriction is that a managed class can only inherit from one base class.

37.

What Is A Metadata In .net?

Answer»

Metadata is information about a PE. In COM, metadata is communicated through non-standardized type libraries.

In .NET, this data is contained in the header portion of a COFF-compliant PE and follows certain guidelines; it contains information such as the assembly’s NAME, version, language (spoken, not computera.k.a., culture), what external types are referenced, what INTERNAL types are exposed, METHODS, properties, classes, and much more.

The CLR uses metadata for a number of specific purposes. Security is managed through a public key in the PE’s header.

Information about classes, modules, and so forth allows the CLR to know in advance what structures are necessary. The class LOADER component of the CLR uses metadata to locate specific classes within assemblies, either locally or across networks.

Just-in-time (JIT) compilers use the metadata to turn IL into executable code.

Other programs take advantage of metadata as well.

A COMMON example is placing a Microsoft Word document on a Windows 2000 desktop. If the document file has completed comments, author, title, or other Properties metadata, the text is displayed as a tool tip when a user hovers the mouse over the document on the desktop. You can use the Ildasm.exe utility to view the metadata in a PE. Literally, this tool is an IL disassembler.

Metadata is information about a PE. In COM, metadata is communicated through non-standardized type libraries.

In .NET, this data is contained in the header portion of a COFF-compliant PE and follows certain guidelines; it contains information such as the assembly’s name, version, language (spoken, not computera.k.a., culture), what external types are referenced, what internal types are exposed, methods, properties, classes, and much more.

The CLR uses metadata for a number of specific purposes. Security is managed through a public key in the PE’s header.

Information about classes, modules, and so forth allows the CLR to know in advance what structures are necessary. The class loader component of the CLR uses metadata to locate specific classes within assemblies, either locally or across networks.

Just-in-time (JIT) compilers use the metadata to turn IL into executable code.

Other programs take advantage of metadata as well.

A common example is placing a Microsoft Word document on a Windows 2000 desktop. If the document file has completed comments, author, title, or other Properties metadata, the text is displayed as a tool tip when a user hovers the mouse over the document on the desktop. You can use the Ildasm.exe utility to view the metadata in a PE. Literally, this tool is an IL disassembler.

38.

What Is Gac In .net?

Answer»

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. Assemblies deployed in the global assembly cache must have a STRONG name. When an assembly is added to the global assembly cache, integrity checks are performed on all files that make up the assembly. The cache performs these integrity checks to ensure that an assembly has not been tampered with, for example, when a file has CHANGED but the manifest does not reflect the change. Use a DEVELOPER tool called the Global Assembly Cache tool (Gacutil.exe), provided by the .NET Framework SDK or Use Windows Explorer to drag assemblies into the cache. To install a strong-named assembly into the global assembly cache At the command prompt, type the following command:

gacutil I

In this command, assembly name is the name of the assembly to install in 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. Assemblies deployed in the global assembly cache must have a strong name. When an assembly is added to the global assembly cache, integrity checks are performed on all files that make up the assembly. The cache performs these integrity checks to ensure that an assembly has not been tampered with, for example, when a file has changed but the manifest does not reflect the change. Use a developer tool called the Global Assembly Cache tool (Gacutil.exe), provided by the .NET Framework SDK or Use Windows Explorer to drag assemblies into the cache. To install a strong-named assembly into the global assembly cache At the command prompt, type the following command:

gacutil I

In this command, assembly name is the name of the assembly to install in the global assembly cache.

39.

What Is The Difference Between "using System.data;" And Directly Adding The Reference From "add References Dialog Box"?

Answer»

When U compile a program using command line, u add the REFERENCES using /r switch. When you compile a program using Visual STUDIO, it adds those references to our assembly, which are added using "Add Reference" dialog box. While "using" statement facilitates us to use classes without using their fully qualified names.

For EXAMPLE: if u have added a reference to "System. Data. SqlClient" using "Add Reference" dialog box then u can use SqlConnection CLASS like this:

System.Data.SqlClient.SqlConnection

But if u add a "using System. Data. SqlClient" statement at the start of ur code then u can directly use Sql Connection class.On the other hand if u add a reference using "using System.Data.SqlClient" statement, but don't add it using "Add Reference" dialog box, Visual Studio will give error message while we compile the program

When u compile a program using command line, u add the references using /r switch. When you compile a program using Visual Studio, it adds those references to our assembly, which are added using "Add Reference" dialog box. While "using" statement facilitates us to use classes without using their fully qualified names.

For example: if u have added a reference to "System. Data. SqlClient" using "Add Reference" dialog box then u can use SqlConnection class like this:

System.Data.SqlClient.SqlConnection

But if u add a "using System. Data. SqlClient" statement at the start of ur code then u can directly use Sql Connection class.On the other hand if u add a reference using "using System.Data.SqlClient" statement, but don't add it using "Add Reference" dialog box, Visual Studio will give error message while we compile the program

40.

Creating A Key Pair In .net?

Answer»

You can create a key PAIR using the Strong NAME tool (Sn.exe). Key pair files usually have an .snk EXTENSION. To create a key pair At the command prompt, type the following command:

In this command, file name is the name of the output file containing the key pair. The following example creates a key pair CALLED sgKey.snk

You can create a key pair using the Strong Name tool (Sn.exe). Key pair files usually have an .snk extension. To create a key pair At the command prompt, type the following command:

In this command, file name is the name of the output file containing the key pair. The following example creates a key pair called sgKey.snk

41.

What Is A Manifest In .net?

Answer»

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 (Portable Executable) file (an .exe or .dll) with Microsoft intermediate language (MSIL) code or in a standalone PE (Portable Executable) file that contains only assembly manifest information.

The following table shows the information contained in the assembly manifest. The first four items the assembly name, version NUMBER, culture, and strong name information make up the assembly's identity.

Assembly name: A text string specifying the assembly's name.

Version number: A major and minor version number, and a revision and build number. The common language runtime uses these numbers to enforce version POLICY.

Culture: Information on the culture or language the assembly supports. This information should be used only to designate an assembly as a satellite assembly containing culture- or language-specific information. (An assembly with culture information is automatically assumed to be a satellite assembly.) Strong name information: The public key from the publisher if the assembly has been given a strong name. 

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 (Portable Executable) file (an .exe or .dll) with Microsoft intermediate language (MSIL) code or in a standalone PE (Portable Executable) file that contains only assembly manifest information.

The following table shows the information contained in the assembly manifest. The first four items the assembly name, version number, culture, and strong name information make up the assembly's identity.

Assembly name: A text string specifying the assembly's name.

Version number: A major and minor version number, and a revision and build number. The common language runtime uses these numbers to enforce version policy.

Culture: Information on the culture or language the assembly supports. This information should be used only to designate an assembly as a satellite assembly containing culture- or language-specific information. (An assembly with culture information is automatically assumed to be a satellite assembly.) Strong name information: The public key from the publisher if the assembly has been given a strong name. 

42.

What Is A Strong Name In .net?

Answer»

A strong name consists of the assembly's identity its simple text name, version number, and culture information (if provided) plus a public key and a DIGITAL SIGNATURE. It is generated from an assembly file (the file that contains the assembly manifest, which in turn contains the names and hashes of all the files that MAKE up the assembly), using the corresponding private key. Assemblies with the same strong name are expected to be identical.

Strong names guarantee name uniqueness by relying on unique key pairs. No one can generate the same assembly name that you can, because an assembly generated with one private key has a different name than an assembly generated with another private key.

When you reference a strong-named assembly, you expect to get certain benefits, such as versioning and naming protection. If the strong-named assembly then references an assembly with a simple name, which does not have these benefits, you lose the benefits you would derive from using a strong-named assembly and revert to DLL conflicts. Therefore, strong-named assemblies can only reference other strong-named assemblies.

There are two ways to sign an assembly with a strong name:

1.Using the Assembly Linker (Al.exe) provided by the .NET Framework SDK.
2.Using assembly attributes to INSERT the strong name information in your code. You can use either the AssemblyKeyFileAttribute or the AssemblyKeyNameAttribute, depending

A strong name consists of the assembly's identity its simple text name, version number, and culture information (if provided) plus a public key and a digital signature. It is generated from an assembly file (the file that contains the assembly manifest, which in turn contains the names and hashes of all the files that make up the assembly), using the corresponding private key. Assemblies with the same strong name are expected to be identical.

Strong names guarantee name uniqueness by relying on unique key pairs. No one can generate the same assembly name that you can, because an assembly generated with one private key has a different name than an assembly generated with another private key.

When you reference a strong-named assembly, you expect to get certain benefits, such as versioning and naming protection. If the strong-named assembly then references an assembly with a simple name, which does not have these benefits, you lose the benefits you would derive from using a strong-named assembly and revert to DLL conflicts. Therefore, strong-named assemblies can only reference other strong-named assemblies.

There are two ways to sign an assembly with a strong name:

1.Using the Assembly Linker (Al.exe) provided by the .NET Framework SDK.
2.Using assembly attributes to insert the strong name information in your code. You can use either the AssemblyKeyFileAttribute or the AssemblyKeyNameAttribute, depending

43.

What Is The Difference Between Vb And Vb.net?

Answer»

Now VB.NET is object-oriented language. The following are some of the differences:

Data Type Changes

The .NET platform provides Common Type System to all the supported languages. This means that all the languages must support the same data types as enforced by common language runtime. This eliminates data type incompatibilities between various languages. For example on the 32-bit Windows platform, the integer data type takes 4 bytes in languages like C++ whereas in VB it takes 2 bytes. Following are the main changes related to data types in VB.NET:

  • Under .NET the integer data type in VB.NET is also 4 bytes in size.
  • VB.NET has no currency data type. INSTEAD it provides decimal as a replacement.
  • VB.NET introduces a new data type called Char. The char data type takes 2 bytes and can store Unicode characters.
  • VB.NET do not have VARIANT data type. To achieve a result SIMILAR to variant type you can use Object data type. (Since every thing in .NET including primitive data types is an object, a variable of object type can point to any data type).
  • In VB.NET there is no concept of fixed length strings.
  • In VB6 we used the Type keyword to declare our user-defined structures. VB.NET introduces the structure keyword for the same purpose.
  • Declaring Variables

Consider this simple example in VB6:
Dim x,y as integer

Now VB.NET is object-oriented language. The following are some of the differences:

Data Type Changes

The .NET platform provides Common Type System to all the supported languages. This means that all the languages must support the same data types as enforced by common language runtime. This eliminates data type incompatibilities between various languages. For example on the 32-bit Windows platform, the integer data type takes 4 bytes in languages like C++ whereas in VB it takes 2 bytes. Following are the main changes related to data types in VB.NET:

Consider this simple example in VB6:
Dim x,y as integer

44.

What Is The Difference Between Ado And Ado.net?

Answer»

ADO uses Recordsets and cursors to access and modify data. Because of its INHERENT design, Recordset can impact performance on the server side by tying up valuable resources. In addition, COM marshalling - an expensive data CONVERSION process - is needed to transmit a Recordset. ADO.NET addresses three important needs that ADO doesn't address:

1. Providing a comprehensive disconnected data-access model, which is crucial to the Web environment
2. Providing tight integration with XML, and
3. Providing seamless integration with the .NET Framework (e.g., compatibility with the base class library's type system). From an ADO.NET implementation perspective, the Recordset object in ADO is eliminated in the .NET architecture. In its place, ADO.NET has several dedicated objects led by the DataSet object and including the DataAdapter, and DataReader objects to perform specific tasks. In addition, ADO.NET DATASETS operate in disconnected state whereas the ADO RecordSet objects operated in a fully connected state.

In ADO, the in-memory representation of data is the recordset. In ADO.NET, it is the dataset. A recordset looks like a single table. If a recordset is to CONTAIN data from multiple database tables, it must use a JOIN query, which ASSEMBLES the data from the various database tables into a single result table. In contrast, a dataset is a collection of one or more tables.

ADO uses Recordsets and cursors to access and modify data. Because of its inherent design, Recordset can impact performance on the server side by tying up valuable resources. In addition, COM marshalling - an expensive data conversion process - is needed to transmit a Recordset. ADO.NET addresses three important needs that ADO doesn't address:

1. Providing a comprehensive disconnected data-access model, which is crucial to the Web environment
2. Providing tight integration with XML, and
3. Providing seamless integration with the .NET Framework (e.g., compatibility with the base class library's type system). From an ADO.NET implementation perspective, the Recordset object in ADO is eliminated in the .NET architecture. In its place, ADO.NET has several dedicated objects led by the DataSet object and including the DataAdapter, and DataReader objects to perform specific tasks. In addition, ADO.NET DataSets operate in disconnected state whereas the ADO RecordSet objects operated in a fully connected state.

In ADO, the in-memory representation of data is the recordset. In ADO.NET, it is the dataset. A recordset looks like a single table. If a recordset is to contain data from multiple database tables, it must use a JOIN query, which assembles the data from the various database tables into a single result table. In contrast, a dataset is a collection of one or more tables.

45.

What Is Web.config In .net?

Answer»

In classic ASP all Web site related information was stored in the metadata of IIS. This had the disadvantage that remote Web developers couldn't easily MAKE Web-site configuration changes. For example, if you want to add a custom 404 error page, a setting needs to be made through the IIS admin tool, and you're Web host will likely charge you a FLAT fee to do this for you. With ASP.NET, however, these settings are moved into an XML-formatted text FILE (Web.config) that resides in the Web site's root DIRECTORY. Through Web.config you can specify settings LIKE custom 404 error pages, authentication and authorization settings for the Web sitempilation options for the ASP.NET Web pages, if tracing should be enabled, etc. The Web.config file is an XML-formatted file. At the root level is the tag. Inside this tag you can add a number of other tags, the most common and useful one being the system.web tag, where you will specify most of the Web site configuration parameters. However, to specify application-wide settings you use the tag.

For example, if we wanted to add a database connection string parameter we could have a Web.config file like so.

In classic ASP all Web site related information was stored in the metadata of IIS. This had the disadvantage that remote Web developers couldn't easily make Web-site configuration changes. For example, if you want to add a custom 404 error page, a setting needs to be made through the IIS admin tool, and you're Web host will likely charge you a flat fee to do this for you. With ASP.NET, however, these settings are moved into an XML-formatted text file (Web.config) that resides in the Web site's root directory. Through Web.config you can specify settings like custom 404 error pages, authentication and authorization settings for the Web sitempilation options for the ASP.NET Web pages, if tracing should be enabled, etc. The Web.config file is an XML-formatted file. At the root level is the tag. Inside this tag you can add a number of other tags, the most common and useful one being the system.web tag, where you will specify most of the Web site configuration parameters. However, to specify application-wide settings you use the tag.

For example, if we wanted to add a database connection string parameter we could have a Web.config file like so.

46.

What Is Machine.config In .net?

Answer»

Machine configuration file: The machine.config file contains settings that apply to the ENTIRE computer. This file is located in the %runtime install path%Config directory. There is only one machine.config file on a computer. The Machine.Config file found in the "CONFIG" subfolder of your .NET Framework install directory (c:WINNT Microsoft.NETFramework{Version Number}CONFIG on Windows 2000 installations). The machine. config,which can be found in the directory $WINDIR $Microsoft.NETFrameworkv 1.0.3705CONFIG,is an XML-formatted configuration file that SPECIFIES configuration options for the machine. This file contains, among many other XML ELEMENTS, a browserCaps element. Inside this element are a number of other elements that specify parse rules for the various User-Agents, and what properties each of these parsings supports.

For example, to determine what platform is used, a filter element is used that specifies how to set the platform property BASED on what platform name is found in the User-Agent string. Specifically, the machine.config file contains:

platform=Win95
platform=Win98
platform=WinNT

Machine configuration file: The machine.config file contains settings that apply to the entire computer. This file is located in the %runtime install path%Config directory. There is only one machine.config file on a computer. The Machine.Config file found in the "CONFIG" subfolder of your .NET Framework install directory (c:WINNT Microsoft.NETFramework{Version Number}CONFIG on Windows 2000 installations). The machine. config,which can be found in the directory $WINDIR $Microsoft.NETFrameworkv 1.0.3705CONFIG,is an XML-formatted configuration file that specifies configuration options for the machine. This file contains, among many other XML elements, a browserCaps element. Inside this element are a number of other elements that specify parse rules for the various User-Agents, and what properties each of these parsings supports.

For example, to determine what platform is used, a filter element is used that specifies how to set the platform property based on what platform name is found in the User-Agent string. Specifically, the machine.config file contains:

platform=Win95
platform=Win98
platform=WinNT

47.

Using Activex Control In .net?

Answer»

ActiveX control is a special type of COM component that supports a User Interface. Using ActiveX Control in your .Net Project is even easier than using COM component. They are bundled usually in .ocx files. Again a proxy assembly is made by .Net utility AxImp.exe (which we will see shortly) which your application (or client) uses as if it is a .Net control or assembly. Making Proxy Assembly For ActiveX Control: FIRST, a proxy assembly is made using AxImp.exe (acronym for ActiveX Import) by writing following command on Command PROMPT: C:> AxImp C:MyProjectsMyControl.ocx This command will make TWO dlls, e.g., in case of above command MyControl.dll AxMyControl.dll The first file MyControl.dll is a .Net assembly proxy, which allows you to reference the ActiveX as if it were non-graphical object. The second file AxMyControl.dll is the Windows Control, which allows u to use the graphical aspects of activex control and use it in the Windows FORM Project.

ActiveX control is a special type of COM component that supports a User Interface. Using ActiveX Control in your .Net Project is even easier than using COM component. They are bundled usually in .ocx files. Again a proxy assembly is made by .Net utility AxImp.exe (which we will see shortly) which your application (or client) uses as if it is a .Net control or assembly. Making Proxy Assembly For ActiveX Control: First, a proxy assembly is made using AxImp.exe (acronym for ActiveX Import) by writing following command on Command Prompt: C:> AxImp C:MyProjectsMyControl.ocx This command will make two dlls, e.g., in case of above command MyControl.dll AxMyControl.dll The first file MyControl.dll is a .Net assembly proxy, which allows you to reference the ActiveX as if it were non-graphical object. The second file AxMyControl.dll is the Windows Control, which allows u to use the graphical aspects of activex control and use it in the Windows Form Project.

48.

Advantages Of Vb.net?

Answer»

1.First of all, VB.NET provides MANAGED code execution that runs under the Common Language Runtime (CLR), resulting in robust, stable and secure applications. All features of the .NET framework are readily available in VB.NET.

2.VB.NET is totally object oriented. This is a major addition that VB6 and other earlier releases didn't have.

3.The .NET framework comes with ADO.NET, which FOLLOWS the disconnected paradigm, i.e. once the required records are FETCHED the CONNECTION no LONGER exists. It also retrieves the records that are expected to be accessed in the immediate future. This enhances Scalability of the application to a great extent.

4.VB.NET uses XML to transfer data between the various layers in the DNA Architecture i.e. data are passed as simple text strings.

5.Error handling has changed in VB.NET. A new Try-Catch-Finally block has been introduced to handle errors and exceptions as a unit, allowing appropriate action to be taken at the place the error occurred thus discouraging the use of ON ERROR GOTO statement. This again credits to the maintainability of the code.

1.First of all, VB.NET provides managed code execution that runs under the Common Language Runtime (CLR), resulting in robust, stable and secure applications. All features of the .NET framework are readily available in VB.NET.

2.VB.NET is totally object oriented. This is a major addition that VB6 and other earlier releases didn't have.

3.The .NET framework comes with ADO.NET, which follows the disconnected paradigm, i.e. once the required records are fetched the connection no longer exists. It also retrieves the records that are expected to be accessed in the immediate future. This enhances Scalability of the application to a great extent.

4.VB.NET uses XML to transfer data between the various layers in the DNA Architecture i.e. data are passed as simple text strings.

5.Error handling has changed in VB.NET. A new Try-Catch-Finally block has been introduced to handle errors and exceptions as a unit, allowing appropriate action to be taken at the place the error occurred thus discouraging the use of ON ERROR GOTO statement. This again credits to the maintainability of the code.

49.

Advantages Of Migrating To Vb.net?

Answer»

Visual Basic .NET has many new and improved language features — such as INHERITANCE, interfaces, and overloading that MAKE it a powerful object-oriented programming language. As a Visual Basic DEVELOPER, you can now create multithreaded, scalable applications using explicit multithreading. Other new language features in Visual Basic .NET include structured exception handling, custom attributes, and common language specification (CLS) compliance. The CLS is a set of rules that standardizes such things as data types and how objects are exposed and interoperate. Visual Basic .NET ADDS several features that take advantage of the CLS. Any CLS-compliant language can use the classes, objects, and components you create in Visual Basic .NET. And you, as a Visual Basic user, can access classes, components, and objects from other CLS-compliant programming languages without worrying about language-specific differences such as data types.CLS features used by Visual Basic .NET programs include assemblies, NAMESPACES, and attributes.

Visual Basic .NET has many new and improved language features — such as inheritance, interfaces, and overloading that make it a powerful object-oriented programming language. As a Visual Basic developer, you can now create multithreaded, scalable applications using explicit multithreading. Other new language features in Visual Basic .NET include structured exception handling, custom attributes, and common language specification (CLS) compliance. The CLS is a set of rules that standardizes such things as data types and how objects are exposed and interoperate. Visual Basic .NET adds several features that take advantage of the CLS. Any CLS-compliant language can use the classes, objects, and components you create in Visual Basic .NET. And you, as a Visual Basic user, can access classes, components, and objects from other CLS-compliant programming languages without worrying about language-specific differences such as data types.CLS features used by Visual Basic .NET programs include assemblies, namespaces, and attributes.

50.

Observations Between Vb.net And Vc#.net?

Answer»

Choosing a programming language depends on your language experience and the scope of the application you are building. While small applications are often created using only one language, it is not uncommon to develop large applications using multiple LANGUAGES.For example, if you are extending an application with existing XML Web services, you might use a scripting language with little or no programming effort. For client-server applications, you would probably choose the single language you are most comfortable with for the entire application. For new enterprise applications, where large teams of developers create components and services for deployment across multiple remote sites, the best choice might be to use several languages depending on developer skills and long-term maintenance expectations.The .NET Platform programming languages - including Visual Basic .NET, Visual C#, and Visual C++ with managed extensions, and many other programming languages from various VENDORS - use .NET Framework services and features through a common set of unified classes. The .NET unified classes provide a consistent method of ACCESSING the platform's functionality. If you learn to use the class library, you will find that all tasks follow the same uniform ARCHITECTURE. You no longer need to learn and master different API architectures to write your applications.

Choosing a programming language depends on your language experience and the scope of the application you are building. While small applications are often created using only one language, it is not uncommon to develop large applications using multiple languages.For example, if you are extending an application with existing XML Web services, you might use a scripting language with little or no programming effort. For client-server applications, you would probably choose the single language you are most comfortable with for the entire application. For new enterprise applications, where large teams of developers create components and services for deployment across multiple remote sites, the best choice might be to use several languages depending on developer skills and long-term maintenance expectations.The .NET Platform programming languages - including Visual Basic .NET, Visual C#, and Visual C++ with managed extensions, and many other programming languages from various vendors - use .NET Framework services and features through a common set of unified classes. The .NET unified classes provide a consistent method of accessing the platform's functionality. If you learn to use the class library, you will find that all tasks follow the same uniform architecture. You no longer need to learn and master different API architectures to write your applications.