(Framework

)

1.

2.

3.

4.

What is .NET Framework? 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. What is CLR? The CLS is simply a specification that defines the rules to support language integration in such a way that programs written in any language, yet can interoperate with one another, taking full advantage of inheritance, polymorphism, exceptions, and other features. These rules and the specification are documented in the ECMA proposed standard document, "Partition I Architecture", available here. Is .NET a runtime service or a development platform? Ans: 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. What are the new features of Framework 1.1 ?

1. 2.

Native Support for Developing Mobile Web Applications 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. 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. Native Support for Communicating with ODBC and Oracle Databases Unified Programming Model for Smart Client Application Development The Microsoft .NET Compact Framework brings the CLR, Windows Forms

3.

4.
5.

6.

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. 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.

http://msdn.microsoft.com/netframework/technologyinfo/Overview/whatsnew.aspx

5.

6. 7. 8. 9. 1. All code: Nothing 10. 1.1. Zone - MyComputer: FullTrust 11. 1.1.1. Honor SkipVerification requests: SkipVerification 12. 1.2. Zone - Intranet: LocalIntranet 13. 1.3. Zone - Internet: Internet 14. 1.4. Zone - Untrusted: Nothing 15. 1.5. Zone - Trusted: Internet 16. 1.6. StrongName 0024000004800000940000000602000000240000525341310004000003 17. 000000CFCB3291AA715FE99D40D49040336F9056D7886FED46775BC7BB5430BA444 4FEF8348EBD06 18. F962F39776AE4DC3B7B04A7FE6F49F25F740423EBF2C0B89698D8D08AC48D69CED0 FC8F83B465E08 19. 07AC11EC1DCC7D054E807A43336DDE408A5393A48556123272CEEEE72F1660B7192 7D38561AABF5C AC1DF1734633C602F8F2D5: Everything Note the hierarchy of code groups - the top of the hierarchy is the most general ('All code'), which is then sub-divided into several groups, each of which in turn can be sub-divided. Also note that (somewhat counter-intuitively) a sub-group can be associated with a more permissive permission set than its parent. How do I define my own code group? Use caspol. For example, suppose you trust code from www.mydomain.com and you want it have full access to your system, but you want to keep the default restrictions for all other internet sites. To achieve this, you would add a new code group as a subgroup of the 'Zone - Internet' group, like this: caspol -ag 1.3 -site www.mydomain.com FullTrust Now if you run caspol -lg you will see that the new group has been added as group

What is Code Access Security (CAS)? CAS is the part of the .NET security model that determines whether or not a piece of code is allowed to run, and what resources it can use when it is running. For example, it is CAS that will prevent a .NET web applet from formatting your hard disk. How does CAS work? The CAS security policy revolves around two key concepts - code groups and permissions. Each .NET assembly is a member of a particular code group, and each code group is granted the permissions specified in a named permission set. For example, using the default security policy, a control downloaded from a web site belongs to the 'Zone - Internet' code group, which adheres to the permissions defined by the 'Internet' named permission set. (Naturally the 'Internet' named permission set represents a very restrictive range of permissions.) Who defines the CAS code groups? Microsoft defines some default ones, but you can modify these and even create your own. To see the code groups defined on your system, run 'caspol -lg' from the command-line. On my ssystem it looks like this: Level = Machine Code Groups:

1.3.1: ... 1.3. Zone - Internet: Internet 1.3.1. Site - www.mydomain.com: FullTrust ... Note that the numeric label (1.3.1) is just a caspol invention to make the code groups easy to manipulate from the command-line. The underlying runtime never sees it. How do I change the permission set for a code group? Use caspol. If you are the machine administrator, you can operate at the 'machine' level - which means not only that the changes you make become the default for the machine, but also that users cannot change the permissions to be more permissive. If you are a normal (non-admin) user you can still modify the permissions, but only to make them more restrictive. For example, to allow intranet code to do what it likes you might do this: caspol -cg 1.2 FullTrust Note that because this is more permissive than the default policy (on a standard system), you should only do this at the machine level - doing it at the user level will have no effect. Can I create my own permission set? Yes. Use caspol -ap, specifying an XML file containing the permissions in the permission set. To save you some time, here is a sample file corresponding to the 'Everything' permission set - just edit to suit your needs. When you have edited the sample, add it to the range of available permission sets like this: caspol -ap samplepermset.xml Then, to apply the permission set to a code group, do something like this: caspol -cg 1.3 SamplePermSet (By default, 1.3 is the 'Internet' code group) I'm having some trouble with CAS. How can I diagnose my problem? 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. I can't be bothered with all this CAS stuff. Can I turn it off? Yes, as long as you are an administrator. Just run: caspol -s off

20. What is MSIL, IL?

21.

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. Can I write IL programs directly? 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.

22.

Can I do things in IL that I can't do in C#? Yes. A couple of simple examples are that you can throw exceptions that are not derived from System.Exception, and you can have non-zero-based arrays. What is CTS? The common type system defines how types are declared, used, and managed in the runtime, and is also an important part of the runtime's support for cross-language integration. The common type system supports two general categories of types, each of which is further divided into subcategories: Value types Value types directly contain their data, and instances of value types are either allocated on the stack or allocated inline in a structure. Value types can be built-in (implemented by the runtime), user-defined, or enumerations. Reference types Reference types store a reference to the value's memory address, and are allocated on the heap. Reference types can be self-describing types, pointer types, or interface types. The type of a reference type can be determined from values of self-describing types. Self-describing types are further split into arrays and class types. The class types are user-defined classes, boxed value types, and delegates. What is JIT (just in time)? how it works? 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. What is strong name? A name that consists of an assembly's identity—its simple text name, version number, and culture information (if provided)—strengthened by a public key and a digital signature generated over the assembly. What is portable executable (PE)? The file format defining the structure that all executable files (EXE) and Dynamic Link Libraries (DLL) must use to allow them to be loaded and executed by Windows. PE is derived from the Microsoft Common Object File Format (COFF). The EXE and DLL files created using the .NET Framework obey the PE/COFF formats and also add additional header and data sections to the files that are only used by the CLR. The specification for the PE/COFF file formats is available at http://www.microsoft.com/whdc/hwdev/hardware/pecoffdown.mspx Which namespace is the base class for .net Class library? Ans: system.object What is Event - Delegate? clear syntax for writing a event delegate The event keyword lets you specify a delegate that will be called upon the

2.

3.

4.

5. 6.

". This is crucial behavior when it takes a long time to create an object. What is Application Domain? The primary purpose of the AppDomain is to isolate an application from other applications. creation is on a different thread and minimums and maximums are enforced. You can configure object pooling by applying the ObjectPoolingAttribute attribute to a class that derives from the System.7. creation is on the same thread.) COM+ object pooling is identical to what is used in . but it is expensive and doesn't scale well. 20. Object pooling lets you control the number of connections you use. 12. Following are important differences between object pooling and connection pooling: Creation. but you do not use it for very long.NET Framework managed SQL Client connection pooling. (TPC/C benchmarks rely on this. i). } public static void DelegateFunction(int i) { System. 8.Console.NET Framework Common Language Runtime. it is placed back into the pool to await the next request. Enforcement of minimums and maximums. What are object pooling and connection pooling and difference? Where do we set the Min and Max Pool size for connection pooling? Object pooling is a COM+ service that enables you to reduce the overhead of creating each object from scratch. An event in one program can be made available to other programs that target the .WriteLine("Called by delegate with number: {0}. 15. This is not done in connection pooling. This is effective. 10. When the object is deactivated. 19. Win32 processes provide isolation by having distinct memory address spaces. class Program { public static void Main() { TakesADelegate(new MyDelegate(DelegateFunction)). as opposed to connection pooling. 17. With object pooling. } public static void TakesADelegate(MyDelegate SomeFunction) { SomeFunction(21). However. if you have already reached your maximum. 22.EnterpriseServices. The maximum value in object pooling is very important when trying to scale your application. The delegate can have one or more associated methods that will be called when your code indicates that the event has occurred. 16. When using connection pooling. When an object is activated. the pool might decide to create a new object. The . 13. where you control the maximum number reached. it instead gives you the next available object. it is pulled from the pool. a connection is created on your behalf. } 21. For example. // keyword_delegate. You might need to multiplex thousands of requests to just a few objects. 18. 9. 14.cs // delegate declaration delegate void MyDelegate(int i).ServicedComponent class. 11. so if there is nothing in the pool. } occurrence of some "event" in your code.

How does an AppDomain get created? AppDomains are usually created by hosts.Remoting.GetAppDomainInfo().exe' for this code to work as-is.Runtime. using System.NET application from the command-line.CurrentDomain.NET? What are the ways to control serialization? Serialization is the process of converting an object into a stream of bytes. so the runtime can ensure that AppDomains do not access each other's memory. string info = adInfo. } } 23. which is then written to a data stream.all memory in the AppDomain is managed by the . a copy of the object is passed across application domain boundaries. null ).Serialization can be defined as the process of storing the state of an object to a storage medium. . During this process. The Shell creates a new AppDomain for every application. and then executes one of the object's methods. or to persist objects (e.NET runtime. are converted to a stream of bytes. including the assembly containing the class. Deserialization is the opposite process of creating an object from a stream of bytes. ASP. When the object is subsequently deserialized.g. Note that you must name the executable 'appdomaintest. } } public class App { public static int Main() { AppDomain ad = AppDomain.CreateInstance( "appdomaintest".NET applications.Unwrap()).NET and IE. the host is the Shell. ObjectHandle oh = ad. Here is a C# sample which creates an AppDomain. Objects in different application domains communicate either by transporting copies of objects across application domain boundaries. creates an instance of an object inside it. during remoting).WriteLine( "AppDomain info: " + info ).g.CreateDomain( "Andy's new domain". CAppDomainInfo adInfo = (CAppDomainInfo)(oh. "CAppDomainInfo" ). When you run a . AppDomains can also be explicitly created by . the public and private fields of the object and the name of the class.FriendlyName. Console. null. Objects that do not inherit from MarshalByRefObject are implicitly marshal by value.NET runtime enforces AppDomain isolation by keeping control over the use of memory . Serialization/Deserialization is mostly used to transport objects (e. MarshalByRefObject is the base class for objects that communicate across application domain boundaries by exchanging messages using a proxy. public class CAppDomainInfo : MarshalByRefObject { public string GetAppDomainInfo() { return "AppDomain = " + AppDomain. What is serialization in . When a remote application references a marshal by value object. an exact clone of the original object is created.. Examples of hosts are the Windows Shell. return 0. or by using a proxy to exchange messages. to a file or database). using System.

and the Toolbox. you can create a custom control by deriving from one of the base control classes. SoapFormatter and BinaryFormatter do not have this restriction. if you need a control that encapsulates a button and a text box. XML serialization serializes only public properties and fields and does not preserve type fidelity. For example.NET server controls. The main difference between the two controls lies in ease of creation vs. If an existing server control almost meets your requirements but lacks some required features. 26. 24. There are several ways that you can create Web custom controls: You can compile a control that combines the functionality of two or more existing controls. including full support for Visual Studio design features such as the Properties window.NET server controls meet the specific requirements of your applications. disk. and events. They can include all the design-time features of standard ASP. What are server controls? ASP. Web user controls are easy to make.NET server controls are components that run on the server and encapsulate user-interface and other related functionality. This is useful when you want to provide or consume data without restricting the application that uses the data. Because XML is an open standard. Why do I get errors when I try to serialize a Hashtable? XmlSerializer will refuse to serialize instances of any class that implements IDictionary. but they can be less convenient to use in advanced scenarios. They are used in ASP.Binary serialization preserves type fidelity. What is the difference between Web User Control and Web Custom Control? Custom Controls Web custom controls are compiled components that run on the server and that encapsulate user-interface and other related functionality into reusable packages. You can serialize an object to a stream. If none of the existing ASP. you can customize the control by deriving from it and overriding its properties. What is the use of trace utility? ** 25. user controls can be created in the . Both are available for use in your own code. which makes it an attractive choice. and so forth. it is an attractive choice for sharing data across the Web. SOAP is an open standard. You develop Web user controls almost exactly the same way that you develop Web Forms pages. methods.g. ease of use at design time. so you can focus on programming the features you need. For example. you can create either a Web user control or a Web custom control that encapsulates the functionality you need. you can share an object between different applications by serializing it to the clipboard. the visual designer.XmlSerializer and SoapFormatter/BinaryFormatter. Microsoft uses XmlSerializer for Web Services. These classes provide all the basic functionality of Web server controls. Like Web Forms. memory.NET pages and in ASP. which is useful for preserving the state of an object between different invocations of an application. you can create it by compiling the existing controls together. and uses SoapFormatter/BinaryFormatter for remoting. There are two separate mechanisms provided by the . e. If none of the existing Web server controls (or their combinations) meet your requirements. over the network. Remoting uses serialization to pass objects "by value" from one computer or application domain to another. Hashtable.NET class library .NET code-behind classes.

then the exception is discarded. the system searches for the nearest catch clause that can handle the exception. in the global assembly cache Can be added to the Toolbox in Visual Studio Good for dynamic layout 27. Web custom controls must be authored in code. A catch clause that doesn't name an exception class can handle any exception. and that exception is not caught. In addition. you can add it to the Toolbox and display it in a visual designer with full Properties window support and all the other design-time features of ASP. and they are represented by a simple placeholder glyph when added to a page. If that fails. the only way to share the user control between applications is to put a separate copy in each application. which makes them easier to use but more difficult to create. What is exception handling? When an exception occurs. However. any finally clauses that were associated with try statements more nested that than the one that caught the exception.NET Framework applications. reuse. because Web user controls are compiled dynamically at run time they cannot be added to the Toolbox. Exceptions that occur during destructor execution are worth special mention. which takes more maintenance if you make changes to the control. First. Also. the system first executes. An assembly is a collection of types and resources that are built to work together and form a logical unit of functionality. What is Assembly? Assemblies are the building blocks of . or a base class. Before execution of the catch clause begins. 28. including the Properties window and Design view previews. This makes Web user controls harder to use if you are accustomed to full Visual Studio . To the runtime. Web custom controls are compiled code. a type does not exist outside the context of an assembly. the current method is searched for a lexically enclosing try statement. then the execution of that destructor is terminated and the destructor of the base class (if any) is called. as determined by the run-time type of the exception. and they can handle execution events. If there is no base class (as in the case of the object type) or if there is no base class destructor. the system prepares to transfer control to the first statement of the catch clause.visual designer. An assembly provides the common language runtime with the information it needs to be aware of type implementations. . by naming an exception class that is of the same class. you can install a single copy of the Web custom control in the global assembly cache and share it between applications. 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. of the run-time type of the exception being thrown. however. they can be written with code separated from the HTML.NET designtime support. Web user controls Easier to create Limited support for consumers who use a visual design tool A separate copy of the control is required in each application Cannot be added to the Toolbox in Visual Studio Good for static layout Web custom controls Harder to create Full visual design tool support for consumers Only a single copy of the control is required. they form the fundamental unit of deployment. activation scoping. which makes maintenance easier. and security permissions. Once a matching catch clause is found. Once you have created the control. and the associated catch clauses of the try statement are considered in order. This search continues until a catch clause is found that can handle the current exception. version control.NET server controls. If an exception occurs during destructor execution. in order.

A set of resources. Note that each assembly can have only one entry point (that is. such as Visual Studio .NET Framework to create dynamic assemblies. A type called MyType loaded in the scope of one assembly is not the same as a type called MyType loaded in the scope of another assembly. What is the difference between a private assembly and a shared assembly? 1. WinMain.exe files. It forms a type boundary. The assembly is the smallest versionable unit in the common language runtime. You can also use common language runtime APIs. Static assemblies can include . or Main). What are the contents of assembly? In general. Microsoft intermediate language (MSIL) code that implements the types.Emit. Public/Shared. Static assemblies are stored on disk in PE files. can be retrieved on demand. It forms a deployment unit. which contains assembly metadata. . JPEG files. It forms a reference scope boundary. to create dynamic assemblies. Every type's identity includes the name of the assembly in which it resides. There are several ways to create assemblies.dll or . which are run directly from memory and are not saved to disk before execution. The assembly's manifest contains assembly metadata that is used for resolving types and satisfying resource requests. such as localization resources or assemblies containing utility classes. The manifest also enumerates other assemblies on which it depends. You can use development tools. and is stored in the application's directory. DllMain. Location and visibility: A private assembly is normally used by a single application.NET Framework.Assemblies are a fundamental part of programming with the . 29. You can save dynamic assemblies to disk after they have executed. The assembly's manifest describes the version dependencies you specify for any dependent assemblies. a static assembly can consist of four elements: The assembly manifest. It forms a security boundary. resource files. Other assemblies. What are the different types of assemblies? Private. Microsoft intermediate language (MSIL) code in a portable executable (PE) file will not be executed if it does not have an associated assembly manifest. or a sub-directory beneath. You can also use the . This allows applications to be kept simple and thin when first downloaded. 30. and so on).NET Framework SDK to create assemblies with modules created in other development environments. You can use tools provided in the . only the assemblies that the application initially calls must be present. Type metadata.NET Framework types (interfaces and classes). A shared assembly is normally stored in the global assembly cache. Satellite 31. An assembly performs the following functions: It contains code that the common language runtime executes. It forms a version boundary. It specifies the types and resources that are exposed outside the assembly. It is the unit at which side-by-side execution is supported. When an application starts. An assembly is the unit at which permissions are requested and granted. such as Reflection. all types and resources in the same assembly are versioned as a unit. that you have used in the past to create .NET. as well as resources for the assembly (bitmaps. Assemblies can be static or dynamic.

Information that describes every element managed by the common language runtime: an assembly. It contains Assembly name. (For example. Information on referenced assemblies. Shared assemblies are usually libraries of code which many applications will find useful. Versioning: The runtime enforces versioning constraints only on shared assemblies. loadable file. What are Satellite Assemblies? How you will create this? How will you get the different language strings? Satellite assemblies are often used to deploy language-specific resources for an application. metadata .exe or . The assembly manifest contains this assembly metadata. specifies the files that make up the assembly implementation. This can include information required for debugging and garbage collection.An integral part of every assembly that renders the assembly self-describing. Difference between assembly manifest & metadata? assembly manifest .NET Framework version. Type reference information. contains a collection of data that describes how the elements in the assembly relate to each other. and specifies the set of permissions required for the assembly to run properly. regardless of its language. The assembly manifest can be stored in either a PE file (an . Version number. 24. The manifest establishes the assembly identity. and validate the integrity of loaded assemblies. e. 23.NET Framework version is being removed. always uses the same core runtime files.com/lpt/a/2637 ** How will u load dynamic assembly? How will create assemblies at run time? ** What is Assembly manifest? what all details the assembly manifest will contain? Every assembly.NET Framework version 1. Strong name information. method. 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. The assembly manifest contains the assembly's metadata. specifies the types and resources that make up the assembly.NET Framework version 1. When uninstalling.1 adds satellite assemblies with localized resources in a \ja subdirectory. extended class and member definitions. Culture.1. An application that supports the . and so on. An assembly manifest contains all the metadata needed to specify the assembly's version requirements and security identity. 25.2. not on private assemblies. English and Japanese editions of the . marshaling data. 26. as well as security attributes.NET framework classes.ondotnet. whether static or dynamic. .) http://www.dll) with Microsoft intermediate language (MSIL) code or in a standalone PE file that contains only assembly manifest information. itemizes the compile-time dependencies on other assemblies. which is a repository of assemblies maintained by the . enforce version binding policy. The Japanese .NET runtime.1 share the same core files. the application removes only the satellite assemblies associated with a given language and . and other information required by the runtime.NET Framework files are removed unless the last language for that . List of all files in the assembly.NET Framework version 1.g. the . The self-describing nature of assemblies also helps makes zero-impact install and XCOPY deployment feasible. This information is used at run time to resolve references. version binding. No core . type. and all metadata needed to define the scope of the assembly and resolve references to resources and classes.

Readonly vs.Reflection.27.with in AssemblyInfo.g.Create a strong name using sn.Ticks. . 30. how to say that name in the code? A: The primary steps to properly design custom attribute classes are as follows: 28.Emit. What is Reflection in . Therefore. 29.Now. 31.NET compilers produce metadata about the types defined in the modules they produce.Net? Garbage collection process? The process of transitively tracing through all pointers to actively used objects in order to locate all objects that can be referenced. Using reflection to access . Steps . The common language runtime garbage collector also compacts the memory that is in use to reduce the working space needed for the heap.dll tool) or gacutil -i abc. readonly fields can have different values depending on the constructor used.InvokeMember). 33. What is Custom attribute? How to create? If I'm having custom attribute in an assembly. The global assembly cache stores assemblies specifically designated to be shared by several applications on the computer. This metadata is packaged along with the module (modules in turn are packaged together in assemblies). The System.dll If I have more than one version of one assemblies. and it is used for similar purposes . as in the following example: public static readonly uint l1 = (uint) DateTime.Reflection namespace contains classes that can be used to interrogate the types for a module/assembly.NET? Namespace? How will you load an assembly which is not referenced by current assembly? All . const? A const field can only be initialized at the declaration of the field. determining data type sizes for marshaling data across context/process/machine boundaries.NET metadata is very similar to using ITypeLib/ITypeInfo to access type library data in COM. A readonly field can be initialized either at the declaration or in a constructor. 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? Each computer where the common language runtime is installed has a machine-wide code cache called the global assembly cache.snk . or even create types dynamically at run-time (see System. Reflection can also be used to dynamically invoke methods (see System. and then arranging to reuse any heap memory that was not found during this trace. 32. while a const field is a compile-time constant. the readonly field can be used for runtime constants.recompile project. You should share assemblies by installing them into the global assembly cache only when you need to.exe tool eg: sn -k keyPair. Also. then how'll I use old version (how/where to specify version number?)in my application? ** How to find methods of a assembly file (not using ILDASM) Reflection What is Garbage Collection in .Type. and can be accessed by a mechanism called reflection.snk")] .cs add the generated file name eg: [assembly: AssemblyKeyFile("abc.TypeBuilder). then install it to GAC by either drag & drop it to assembly folder (C:\WINDOWS\assembly OR C:\WINNT\assembly) (shfusion.e.

enhanced security. it benefits from features such as cross-language integration.MemberInfo info = typeof(MyClass). } 45. 40. Code that you develop with a language compiler that targets the runtime is called managed code.GetCustomAttributes(). versioning and deployment support.Attribute { // . for example. The following example demonstrates the basic way of using reflection to get access to custom attributes.Threading. Inherited = false. Compilers and tools expose the runtime's functionality and enable you to write code that benefits from this managed execution environment.myvalue = value. a simplified model for component interaction. . i ++) 42. which manages the execution of code and provides services that make the development process easier.myvalue. The using directive has two uses: Create an alias for a namespace (a using alias). System. What is the managed and unmanaged code in . set {this. } 34. 3. A using statement can be exited either when the end of the using statement is reached or if. { 39. (class public class MyAttribute : System.All. Describe the Managed Execution Process? The managed execution process includes the following steps: . cross-language exception handling. Applying the AttributeUsageAttribute ([AttributeUsage(AttributeTargets.} i. Declaring properties e.myvalue = myvalue. } } 2. }) d.net? The .Length. System. 41.WriteLine(attributes[i]). { 37. for (int i = 0.Thread Serialize and MarshalByRef? using directive vs using statement You create an instance in a using statement to ensure that Dispose is called on the object when the using statement is exited. 35. 32. Declaring constructors (public MyAttribute(bool myvalue) { this. { 43. }) c.NET? What is the namespace for that? ** System. public static void Main() 38.NET Framework provides a run-time environment called the Common Language Runtime. an exception is thrown and control leaves the statement block before the end of the statement.a. public bool MyProperty f.} h. .Reflection. 44. class MainClass 36. you do not have to qualify the use of a type in that namespace (a using directive). Declaring the attribute. such that. object[] attributes = info. i < attributes. 5. Permit the use of types in a namespace. { g. and debugging and profiling services. get {return this. How do you create threading in . AllowMultiple = true)]) b.Console. 4.

During this compilation.NET Framework make it easy to add ADSI functionality with the DirectoryEntry and DirectorySearcher components.DirectoryServices. At execution time. Compiling your code to Microsoft intermediate language (MSIL). 5. Visual Studio . and administering user accounts. 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. Periodically. such as backing up databases. It enables your applications to interact with diverse directories on a network. 33. What is Active Directory? What is the namespace used to access the Microsoft Active Directories? What are ADSI Directories? Active Directory Service Interfaces (ADSI) is a programmatic interface for Microsoft Windows Active Directory. Compiling translates your source code into MSIL and generates the required metadata. the garbage collector performs garbage collection to reclaim memory allocated to objects for which there are no valid references. a just-in-time (JIT) compiler translates the MSIL into native code. using System. Integrate directory information with databases such as SQL Server. 4. Using ADSI. hierarchical structure for administering and maintaining diverse and complicated network configurations by accessing an Active Directory tree. The DirectoryEntry component class provides username and password properties that can be entered at runtime and communicated to the Active Directory object you are binding to. The DirectoryServices namespace provides the classes to perform most administrative functions. an application can force garbage collection using the Collect method. Alternatively. How Garbage Collector (GC) Works? The methods in this class influence when an object is garbage collected and when resources allocated by an object are released. Garbage collection consists of the following steps: . Compiling MSIL to native code. ADSI technology allows for searching for an object by specifying two query dialects: SQL and LDAP. 6. Choosing a compiler. 46. Properties in this class provide information about the total amount of memory available in the system and the age category. Use a single application programming interface (API) to perform tasks on multiple directory systems by offering the user a variety of protocols to use. Perform "rich querying" on directory systems. you must use one or more language compilers that target the runtime. accessing printers.3. 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.NET connection string provided that it is using the LDAP provider. of memory allocated to an object. or generation. Executing your code. The DirectoryEntry path may be used as an ADO. To obtain the benefits provided by the common language runtime. you can create applications that perform common administrative tasks. Garbage collection happens automatically when a request for memory cannot be satisfied using available free memory. using a single interface. ADSI makes it possible for you to: Log on once to work with diverse directories. Access and use a single.NET and the .

53. will it be Requests that the system not call the finalizer method for the specified object. sometimes called the global namespace. public static void SuppressFinalize( object obj ). The elements of a jagged array can be of different dimensions and sizes. what steps you will u take care? What is custom events? How to create it? generated MSIL again? 55. How to create events for a control? 60. 49. Objects that implement the IDisposable interface can call this method from the IDisposable.exe) is a 32-bit tool that you use to build projects based on commands contained in a . Namespaces implicitly have public access and this is not modifiable. 9. is present in every file. What is Asynchronous call and how it can be implemented using delegates? 64. 51. C++ & C# differences ** If you want to write your own dot net language. Describe the difference between inline and code behind . The garbage collector attempts to finalize objects that are not referenced. usage : nmake -a all What are Namespaces? The namespace keyword is used to declare a scope.7." (COM) . How can you read 3rd line from a text file? 63. What is Jagged Arrays? A jagged array is an array whose elements are arrays.SupressFinalize? 48. What is the difference between Array and LinkedList? 65. What is the difference between ref & out parameters? 58. a default namespace is created. This unnamed namespace.Dispose method to prevent the garbage collector from calling Object. Why do we need to call CG. The garbage collector frees objects that are not referenced and reclaims their memory. how dot net compiled code will become platform independent? 54. Practical Example of Passing an Events to delegates 62. A jagged array is sometimes called an "array-of-arrays.which is best in a loosely coupled solution? 56. 59. 52. 8. Any identifier in the global namespace is available for use in a named namespace.mak file. What is nmake tool? The Nmake tool (Nmake. The method removes obj from the set of objects that require finalization. without modifying source code if we compile again. 50. The garbage collector searches for managed objects that are referenced in managed code. Explain about SOAP What is the difference between arrays and Arraylist? What are indexers? 61. Even if you do not explicitly declare one. The obj parameter is required to be the caller of this method. This namespace scope lets you organize code and gives you a way to create globally-unique types.Finalize on an object that does not require it. What is the difference between CONST and READONLY? 57. 47.

transparently.NET clients. Interop Services? The common language runtime provides two mechanisms for interoperating with unmanaged code: Platform invoke. strings. 42.Net architecture? What is the difference between them? ** Can we copy a COM dll to GAC folder? ** What is Pinvoke? Platform invoke is a service that enables managed code to call unmanaged functions implemented in dynamic-link libraries (DLLs). structures. which enables managed code to call functions exported from an unmanaged library. 41. COM developed using the new . You can also access these registration features programmatically with the System. It locates and invokes an exported function and marshals its arguments (integers. which are not there in COM (MTS)? ** Is the COM architecture same as . Is it true that COM objects no longer need to be registered on the server? Answer: Yes and No.NET Framework classes. which enables managed code to interact with COM objects through interfaces. such as those in the Win32 API.NET Framework Services Installation Tool (Regsvcs.EnterpriseServicesRegistrationHelper class by creating an instance of class RegistrationHelper and using the method InstallAssembly What is use of ContextUtil class? ContextUtil is the preferred class to use for obtaining COM+ context information. COM interop.NET Framework SDK provides the . if required. Legacy COM objects still need to be registered on the server before they can be used. What is RCW (Runtime Callable Wrappers)? The common language runtime exposes COM objects through a proxy called the runtime callable wrapper (RCW). including . 36. What is the new three features of COM+ services. its primary function is to marshal calls between a . 40. Although the RCW appears to be an ordinary object to . 37.NET 39. and so on) across the interoperation boundary as needed.exe .NET? 35. How CCW and RCW is working? ** 38. Both platform invoke and COM interop use interop marshaling to accurately move method arguments between caller and callee and back.66. . 44. 34. How will you register com+ services? The . 43.a command-line tool) to manually register an assembly containing serviced components.NET client and a COM object. How does u handle this COM components developed in other programming languages in . arrays. What is CCW (COM Callable Wrapper) A proxy object generated by the common language runtime so that existing COM applications can use managed classes.

It is the compiler's job to select the specific action (that is.NET Framework components use the features of Component Services? Answer: Yes. 48. 2) Inheritance: It is the process by which one object acquires the properties of another object. the fields will remain unassigned and the object cannot be used until all of the fields are initialized. A struct is a value type. It can inherit its general attributes from its parent. Although it is possible to represent a point as a class.htm (OOPS) 46. while a class is a reference type. by use of inheritance.Int32 and System. the struct is less expensive. Rectangle. these are called value types. A struct cannot inherit from another struct or class. For example. and Color. Without the use of hierarchies. The runtime supports two kinds of value types: Built-in value types The . an object need only define those qualities that make it unique within its class. inherit from the base class Object. structs can be instantiated without using the new operator. .NET. In short it isolates a particular code and data from all other codes and data.com/library/techart/Pahlcompserv. it gets created and the appropriate constructor is called.NET Framework defines built-in value types.microsoft.NET Framework. What are the OOPS concepts? 1) Encapsulation: It is the mechanism that binds together code and data in manipulates. multiple methods". http://msdn. The specific action is determined by the exact nature of the situation. such as System. you can use the features and functions of Component Services from a . What is the difference between a Struct and a Class? The struct type is suitable for representing lightweight objects such as Point. Can .NET Framework component. such as integers and floating-point numbers. A default constructor is always provided to initialize the struct members to their default values. This supports the hierarchical classification.NET? Most programming languages provide built-in data types. However. each object would need to define all its characteristics explicitly. Unlike classes. if you declare an array of 1000 Point objects. 3) Polymorphism: It is a feature that allows one interface to be used for general class of actions. Structs. This helps reduce complexity by allowing the same interface to be used to specify a general class of action. Developers will be able to autoregister these objects just by placing them in the 'bin' folder of the application. 45. Integer & struct are value types or reference types in . In the .Framework will not need to be registered. and keeps both safe from outside interference and misuse. In this case. and it cannot be the base of a class. A well-defined interface controls the access to that particular code and data. A new sub-class inherits all of the attributes of all of its ancestors. In general polymorphism means "one interface. Value type & reference types difference? Example from . When you create a struct object using the new operator. and it does that exactly as classes do. which correspond and are identical to primitive data types used by programming languages. you will allocate additional memory for referencing each object. that are copied when they are passed as arguments (that is. a struct is more efficient in some scenarios. It is an error to initialize an instance field in a struct. they are passed by value).Boolean. There is no inheritance for structs as there is for classes. If you do not use new. This means that it is possible to design a generic interface to a group of related activities. It is an error to declare a default (parameterless) constructor for a struct. method) as it applies to each situation. however. A struct can implement interfaces. 47.

51. 62. store references to the actual data. or an event. If you want to define a type representing a value that is small. such as a complex number (using two floating-point numbers). which derive from System. 56. an indexer. 52. you should define it as a class instead.ValueType. . 54. Shared and Repeatable Inheritance? ** What is Method overloading? Method overloading occurs when a class contains two methods with the same name. a property. Its possible from derived classes using base keyword.User-defined value types Your language will provide ways to define your own value types. The overridden base method must be virtual. An override method provides a new implementation of a member inherited from a base class. 59. 55. The overridden base method must have the same signature as the override method. This following are the reference types: class interface delegate This following are the built-in reference types: object string What is Inheritance. 58. referred to as objects. Its possible by inheriting from that class also. 64. The method overridden by an override declaration is known as the overridden base method. } } class b:a { public int j() { return m(). 65. What is Method Overriding? How to override a function in C#? Use the override modifier to modify a method. but different signatures. Multiple Inheritance. 50. } } 49. or override. 57. abstract. You have one base class virtual function how will call that function from derived class? Ans: class a { public virtual int m() { return 1. you might choose to define it as a value type because you can pass the value type efficiently by value. You cannot override a non-virtual or static method. If the type you are defining would be more efficiently passed by reference. 66. Variables of reference types. 53. 63. 61. 60. Can we call a base class method without creating instance? Its possible If its a static method.

public static void Main() 91. //Implementation goes here 103. } 96. Console. public virtual string Display() 101. For the above code What is the "new" keyword and Which Class Method is 97. 84. { 74. 95. IdentifierToken Variable=new IdentifierToken().67. and modify it with the new modifier. } 90. declare it in the derived class using the same name.NET/C# achieve polymorphism? ** 70. public new string Display() //What is the use of new keyword 81. return "base". { 102.Display()). } 78. class IdentifierToken:Token 79. class Token 99. { 92. What is Polymorphism? How does VB. } 86. { 100. What are Sealed Classes in C#? The sealed modifier is used to prevent derivation from a class. { 72. Method(Variable). { 88. //Implementation goes here 75. C# Language features 68. 76. static void Method(Token t) 87. { 80. (A sealed class cannot also be an abstract class) 69. } 85. { 82.Write(t. 104. Console. class Token 71. public string Display() 73. return "derive". called here A: it will call base class Display method 98.ReadLine(). return "base". 93. //Which Class Method is called here 94. } . } 77. A compile-time error occurs if a sealed class is specified as the base class of another class. To hide an inherited member. 89. //Implementation goes here 83. } 105. In which cases you use override and new base? Use the new modifier to explicitly hide a member inherited from a base class.

106. Constants Static final constants only. { 110. On the other constants are possible. and/or just stubs that have to be overridden. They are implemented by classes.Write(t. methods. } 113. it can be added to the base class without breaking code. A: Derive 125. 123. interfaces do not provide implementation. } 118. } 114. public static void Main() 119. A class may extend only one abstract class. implementation much less default code. return "derive". Console. because if additional functionality is needed in derived classes. default code. these unqualified static and instance intialiser code names pollute the are also possible to compute the namespace. them and it is not obvious where they are coming from since the qualification is optional. You can use constants. } 124. Even though class inheritance allows your classes to inherit implementation from a base class.Display()). //Which Class Method is called here 122. IdentifierToken Variable=new IdentifierToken(). 117. it also forces you to make most of your design decisions when the class is first published. Abstract Classes Feature Interface Abstract class Multiple inheritance A class may implement several interfaces. { 116. In which Scenario you will go for Interface or Abstract Class? Interfaces. They also version well. Method(Variable). //Implementation goes here 111. but leave the implementation of other methods until a specific implementation of that class is needed. and defined as separate entities from classes. An abstract class can provide complete code. Interfaces vs. Console. But unlike classes.ReadLine(). Both paw. An interface A third party class must be Third party . Abstract classes are useful when creating components because they allow you specify an invariant level of functionality in some methods. An interface cannot Default provide any code at all. 108. define a set of properties. keyword class IdentifierToken:Token { public override string Display() //What is the use of new 109. { 120. like classes. 121. 107. can use them without qualification in classes that implement the Both instance and static interface. 112. static void Method(Token t) 115. and events.

When you implement the interface. The abstract class author has imposed structure on you. tend towards an abstract base class. (Now all I have to do is come up with a good definition of hetero/homogeneous in this context. An abstract class defines the core identity of its descendants. if your client code talks only in terms of an abstract class. using a factory method. this may be good or bad. with all its attendant baggage. This gives you freedom to implement a radically different internal design. e. Interfaces are often used to describe the peripheral abilities of a class. The constant declarations You can put shared code into an Terseness . they are not merely dogable. Implemented interfaces enumerate the general things a class can do.g. then tend towards an interface.convenience implementation may be added to any existing third party class. use an interface. good or bad. homogeneous. usually an abstract class works best. then tend towards a common base class. you can easily change the concrete implementation behind it. not the things a class is. If your client code talks only in terms of an interface. then an interface works best." If implementors/subclasses are homogeneous. You must use the abstract class as-is for the code base. requires extra indirection to find the corresponding method in the actual class. Plug-in You can write a new replacement module for an interface that contains not one stick of code in common with the existing implementations. If the various implementations are all of a kind and share a common status and behavior. Another issue that's important is what I call "heterogeneous vs. you can easily change the concrete implementation behind it. If all the various implementations share is Homogeneity the method signatures. you start from scratch without any default implementation.) If the various objects are all of-a-kind. Maintenance Speed Slow. Just like an interface. using a factory method. If they are heterogeneous. If all they share is a set of method signatures. Modern Fast JVMs are discovering ways to reduce this speed penalty. and share a common state and behavior. not its central identity. an is-a vs -able or Automobile class might can-do implement the Recyclable interface. You have to obtain your tools from other classes. Depending on the cleverness of the author of the abstract class. which could apply to many otherwise totally unrelated objects. If you defined a Dog abstract class then Damamation descendants are Dogs. nothing comes with the interface other than a few constants. rewritten to extend only from the abstract class.

you will have to write other bubblegum to arrange that. so you may leave that part out. } 131.ICommonImplements2 { public int getCommon() { return 1. interface IWeather 140. public void display() 146. { 129. public class A:IWeather 144. You may use methods to compute the initial values of your constants and variables. interface ICommon 128. { 145. } } 139. { 133. interface ICommonImplements1:ICommon 132. If you add a new method to an interface. abstract class. If you add a new method to an abstract class. } 143. interface ICommonImplements2:ICommon 135. You can't call any methods to compute the initial values of your constants.in an interface are all presumed public static final. If interfaces want to share code. } 137. where you cannot into an interface.ICommonImplements2 138. { . } 134. { } How to implement getCommon method in class a? Are you seeing any problem in the implementation? Ans: public class a:ICommonImplements1. you must track down all implementations of that interface in the universe and provide them with a concrete implementation of that method. int getCommon(). void display(). You must declare all the individual methods of an abstract class abstract. { 141. 130. They are all presumed so. Then all existing code will continue to work without change. 142. both instance and static. Adding functionality 126. see the code 127. { 136. you have the option of providing a default implementation of it. You need not declare individual methods of an interface abstract. public class a:ICommonImplements1.

{ 163. } 159. string Display().Show("C"). } how to implement the Display in the class printDoc (How to resolve the naming Conflict) A: no naming conflicts class PrintDoc:IPrint. int Count { get. { 155.IWeather 154. 164. will it work? 161. { 184. } 177. public class B:A 151. } 176. public void display() 156.display(). void Count(int i). public class C:B. } 165. 148.147. interface IWrite 166. When I instantiate C. { 167. //Here is implementation 172. } } 173. { . class PrintDoc:IPrint. } 169. ICounter {} 182. MessageBox. interface IListCounter: IList. 158. { 175. { 171. string Display(). { 157. interface IList 174. class C 183. void Test(IListCounter x) 185. 180. MessageBox.Show("A"). } 149. 168. } 160. } 153. { 152.IWrite 170.IWrite { public string Display() { return "s". } 150. interface ICounter 178. set. { 179. interface IPrint 162. } 181.

Dim FS As FileStream ' Assign a new object to the variable. FileMode. 198. // Ok. // Error 188. protected internal .set 189. but lack many of the advantages of early-bound objects. Early bound objects allow the compiler to allocate memory and perform other optimizations before an application executes.Access is limited to the containing class or types derived from the containing class.Count. “internal” accessspecifier? protected .186.Count = 1. // Ok.Count 190. Difference between type constructor and instance constructor? What is static constructor.Count(1). How can you write a class to restrict that only one object of this class can be created (Singleton class)? (Access specifiers) 195. invokes ICounter. Public. Write one code example for compile time binding and one for run time binding? What is early/late binding? An object is early bound when it is assigned to a variable declared to be of a specific object type. Only one class constructor per type is permitted. } 191.Count(1). x. when we call any static methods/fields in the same class. it is not possible for classes outside the program to derive from the class or to directly create instances of it. Protected. 196. invokes IList. Objects of this type can hold references to any object. internal . ((IList)x). and it cannot use the vararg (variable argument) calling convention. A static constructor is used to initialize a class. ((ICounter)x). Protected Internal.Open) By contrast. x. Explain about Protected and protected internal. (Constructor / Destructor) 197. an object is late bound when it is assigned to a variable declared to be of type Object. (Except Nested classes) Make a constructor private if: .Access is limited to the current assembly or types derived from the containing class.) Class constructors are used for static field initialization. ' Create a variable to hold a new object. What are the access-specifiers available in c#? Private. Dim xlApp As Object xlApp = CreateObject("Excel. FS = New FileStream("C:\tmp. // Error 187.Count = 1. It is called automatically to initialize the class before the first instance is created or any static members are referenced. Can you explain what inheritance is and an example of when you might use it? 194. (It will get executed only 1st time.Access is limited to the current assembly. Internal.txt". } 192. when it will be fired? And what is its use? (Class constructor method is also known as type constructor or type initializer) Instance constructor is executed when a new instance of type is created and the class constructor is executed after the type is loaded and before any one of the type members is accessed.Application") 193. What is Private Constructor? and it’s use? Can you create instance of a class which has Private Constructor? A: When a class declares only private instance constructors.

4. the destructors in its inheritance chain are called. Dispose can be called even if other references to the object are alive. Destructors cannot be overloaded. Overloaded constructor will call default constructor internally? (no) 201.Collect() method. For example. 6. If an external resource is scarce or expensive. and so on. 2. Execution of the destructor for the instance may occur at any time after the instance becomes eligible for destruction. such as window handles (HWND). Therefore. The garbage collector calls this method at some point after there are no longer any valid references to the object. So who has the control over the destructor (in C#)? it's the . When an instance is destructed. Destructors are not inherited. In order to avoid making instance of the class do I need to make all constructors to private? (yes) 200. better performance can be achieved if the programmer explicitly releases resources when they are no longer being used. Points to remember: 1. a class can have. in order. Creating instances of the class would waste memory. 7.GC. you might have a special constructor used only in the implementation of your class' Clone method. So in C++ you have control over the destructors. The consumer of the object should call this method when it is done using the object. 5. Some situations of necessity are memory is exhausted or user explicitly calls System. Provide implicit control by implementing the protected Finalize Method on an object (destructor syntax in C# and the Managed Extensions for C++). An instance becomes eligible for destruction when it is no longer possible for any code to use the instance.. you might want to provide programmers using an object with the ability to explicitly release these external resources before the garbage collector frees the object. database connections. In C# you can never call them. Note that even when you provide explicit control by way of Dispose. http://msdn.com/library/default. which may be declared in it. and cannot be invoked explicitly. GC destroys the objects only when necessary.asp?url=/library/enus/cpguide/html/cpconfinalizemethodscdestructors. at most. implement the Dispose method provided by the IDisposable Interface. 199. 3. you should provide both an explicit and an implicit way to free those resources. . Destructors are invoked automatically. And one can explicitly call the destructors in C++. What is the difference between Finalize and Dispose (Garbage collection) Class instances often encapsulate control over resources that are not managed by the runtime.asp 203. the reason is one cannot destroy an object. .microsoft. Destructors cannot be used with structs. To provide explicit control.You do not want instances of your component to be created. you may have a class containing nothing but Shared utility functions. one destructor. I have 3 overloaded constructors in my class. Thus. and no instance data.Net frameworks Garbage Collector (GC). a class has no destructors other than the one. In some cases. you should provide implicit cleanup using the Finalize method. Finalize provides a backup to prevent resources from permanently leaking if the programmer fails to call Dispose. They are only used with classes. What are virtual destructors? 202. Destructor and finalize Generally in C++ the destructor is called when objects gets destroyed. Thus. For example. from most derived to least derived. And also the objects are destroyed in reverse order that they are created in.You want it to be available only to the class itself.

. . catch 239.. //exception occurred here.204.net tools which u used in projects? 209. 220. What is close method? How its different from Finalize & Dispose? ** 205... { 224. 210. try 214. . catch 228. 225. finally 223. try 235. 230. { 215. .. 237. What is check/uncheck? 207.. What will do to avoid prior case? Ans: 211.//exception occurred here.. } Ans : It will throw exception... { 219. 221... .. } 231. finally 232. 216. catch 218.. } 238.. What is the use of base keyword? Tell me a practical example for base keyword’s usage? 208. . What is boxing & unboxing? 206. { 213. } catch { . What are the different . { . } 217. try { . { 233.. } 226. What'll happen? } finally { . } 222... { 229. . } 227. try 212. } 234. { 236.

251. custDS. The second argument sets the parent DataColumn and the third argument sets the child DataColumn. by default. The example adds a single DataRelation to the Relations collection of the DataSet. 248. The first argument in the example specifies the name of the DataRelation being created. custDS. } 246. break. nwindConn. C# does not support an explicit fall through from one case label to another.Add("CustOrders".. } 242. custDS. Integrated Security=SSPI. .Relations. 241." + "Initial Catalog=northwind"). finally 243. .NET? SqlConnection nwindConn = new SqlConnection("Data Source=localhost. case 1: cost += 25. Each DataTable contains a column named CustID.NET) 249. 247. How would u connect to database using . 245. Control is always passed to the finally block regardless of how the try block exits.Tables["Customers"]. If you want. Adding a DataRelation to a DataSet adds.Tables["Orders"]. or goto default. and to return child or parent rows from a related table. Unlike the C++ switch statement. you can use goto a switch-case. Is goto statement supported in C#? How about Java? Gotos are supported in C#to the fullest. In Java goto is a reserved keyword that provides absolutely no functionality. you can use DataRelation objects to relate one table to another. OR .Open(). (ADO.Net? ADO. The following code example creates a DataRelation using two DataTable objects in a DataSet.240. What are relation objects in dataset and how & where to use them? In a DataSet that contains multiple DataTable objects. case 2: cost += 25.. which serves as a link between the two DataTable objects. to navigate through the tables. goto case 1. Will it go to finally block if there is no exception happened? Ans: Yes. What’s different about switch statements in C#? No fall-throughs allowed. a UniqueConstraint to the parent table and a ForeignKeyConstraint to the child table. Advantage of ADO. The finally block is useful for cleaning up any resources allocated in the try block.Columns["CustID"].NET Does Not Depend On Continuously Live Connections Database Interactions Are Performed Using Data Commands Data Can Be Cached in Datasets Datasets Are Independent of Data Sources Data Is Persisted as XML Schemas Define Data Structures 250. { 244.Columns["CustID"])..

forward-only stream of data from a database. The SqlClient data provider is fast. you create a DataReader by calling Command.NET Framework Data Provider for SQL Server. // Code to get the DataSet not shown here. System.NET Framework Data Provider for Oracle.Data. myReader.classes that make up the .Odbc . myReader.net to connect to database? System. parentCol = DataSet1.GetInt32(0). as shown in the following example. 253. The DataSet is a memory-resident representation of data that provides a consistent relational programming model regardless of the data source.GetString(1)).NET Framework Data Provider for ODBC.Add(relCustOrder).0 and later. execute commands against the source.NET Framework Data Provider for OLE DB-compatible data sources.ExecuteReader().Data.classes that make up the . execute commands.Data. These classes allow you to access ODBC data source in the managed space. while (myReader. parentCol. SqlDataReader myReader = myCommand. used with XML data. Difference between DataReader and DataAdapter / DataSet and DataAdapter? You can use the ADO. childCol).Data.Data. and read the results. childCol = DataSet1. DataSet1.NET DataReader to retrieve a read-only. DataRelation relCustOrder.SqlClient – classes that make up the .Read()) Console. System.Columns["CustID"]. but is optimized for access to SQL Server 7.Close().NET classes are highly optimized for the . which allows you to connect to SQL Server 7. // Add the relation to the DataSet.0.OleDb namespace.Columns["CustID"]. or used . myReader.net / sqlserver combination and achieve optimal results. It can be used with multiple and differing data sources.OracleClient .Relations. and faster than accessing database via the OleDb layer. DataColumn parentCol. DataColumn childCol.private void CreateRelation() { // Get the DataColumn objects from two DataTable objects in a DataSet. Using the DataReader can increase application performance and reduce system overhead because only one row at a time is ever in memory. and it was written with lots of help from the SQL Server team.Tables["Customers"].Tables["Orders"].WriteLine("\t{0}\t{1}". It's faster than the Oracle provider. It's faster because it accesses the native library (which automatically gives you better performance).ExecuteReader to retrieve rows from a data source. relCustOrder = new DataRelation("CustomersOrders". System. and read results. 254. After creating an instance of the Command object. You use the Read method of the DataReader object to obtain a row from the results of the query.Data. Difference between OLEDB Provider and SqlClient ? Ans: SQLClient . These classes allow you to connect to an OLE DB data source. The System. These classes allow you to access an Oracle data source in the managed space.SqlClient namespace is similar to the System. What are the different namespaces used in the project to connect the database? What data providers available in . // Create DataRelation.OleDb – classes that make up the . } 252.

and relationships among the tables.Copies both the structure and data for this DataSet. constraints. Which method do you invoke on the DataAdapter control to load your generated dataset with data? Fill() 256.GetString(1)).Tables){ // For each row.to manage data local to the application. myReader. you can increase overall performance by using the SqlDataAdapter along with its associated SqlCommand and SqlConnection. and constraints. The DataAdapter provides this bridge by mapping Fill.GetInt32(0). For other OLE DB-supported databases. Explain different methods and Properties of DataReader which you have used in your project? Read GetString GetInt32 while (myReader. What happens when we issue Dataset.Rows){ 259. Does not copy any data.ReadXml command? Reads XML schema and data into the DataSet. What will happen? How will you avoid the problem?) ** 261. 258.Read()) Console. Differences between dataset. "Select * from Table1.WriteLine("\t{0}\t{1}".copy? Clone . and Update. The DataSet represents a complete set of data including related tables. 255. print the values of each column. If a dataset contains 100 rows. foreach(DataRow myRow in thisTable. How to check if a datareader is closed or opened? IsClosed() 260. How do you merge 2 datasets into the third dataset in a simple manner? OR If you are executing these statements in commandObject. 257. . myReader. relations. myReader.Close(). The methods and objects in a DataSet are consistent with those in the relational database model.NET while the record is already deleted in SQL SERVER as backend? OR What is concurrency? How will you avoid concurrency when dealing with dataset? (One user deleted one row after that another user through his dataset was trying to update same row. how to fetch rows between 5 and 15 only? ** 264.Copies the structure of the DataSet. If you are connecting to a Microsoft SQL Server database. which changes the data in the DataSet to match the data in the data source. including all DataTable schemas. Copy . use the DataAdapter with its associated OleDbCommand and OleDbConnection objects.clone and dataset.Select * from Table2” how you will deal result set? ** 262. which changes the data in the data source to match the data in the DataSet. The DataAdapter serves as a bridge between a DataSet and a data source for retrieving and saving data. How do you sort a dataset? ** 263. In how many ways we can retrieve table records count? How to find the count of records in a dataset? foreach(DataTable thisTable in myDataSet. The DataSet can also persist and reload its contents as XML and its schema as XML Schema definition language (XSD) schema. What happens when u try to update data in a dataset in .

Try. Order of events in an asp. Inheritance. and all .net framework.NET page works? Explain about asp. can work with servers browsers that don't support cookies built on top of the window & IIS. How to generate XML from a dataset and vice versa? ** 267. Finally Down-level Support Cultures User Controls In-built client side validation It can span across servers. What is method to get XML and schema from Dataset? ans: getXML () and get Schema () 268. the LoadViewState method ViewState property of a control is automatically populated as described in Maintaining State in a Control.net page life cycle? ** 271.NET) 269. How do u implement locking concept for dataset? ** (ASP. It can Session . What is the use of parameter object? ** 266. Method or event to override Init event (OnInit method) Load view state At the end of this phase. Catch. Asp.265.net and asp – differences? Code Render Block Request/Response Code Declaration Block Compiled Event Driven Object Oriented Constructors/Destructors. How ASP and ASP. it was always a separate entity & its functionality was limited. It shares many of the same objects that traditional applications would use. overloading. its an integral part of OS under the .net objects are available for asp.net page? Control Execution Lifecycle? Phase Initialize What a control needs to do Initialize settings needed during the lifetime of the incoming Web request.net's consumption. A control can override the .weren't transferable across survive server crashes. Exception Handling . Garbage Collection Declare variable with datatype In built graphics support Cultures 270..

References to expensive resources such as database connections must be released in this phase. Any changes (OnPreRender method) made to the state of the control in the prerender phase can be saved. and form controls reflect client-side data. This string object is sent to the client and back as a hidden variable. while changes made in the rendering phase are lost. RaisePostDataChangedEvent method (if IPostBackDataHandler is implemented) RaisePostBackEvent method(if IPostBackEventHandler is implemented) Send postback Raise change events in response change to state changes between the notifications current and previous postbacks. Handle postback events Prerender Handle the client-side event that caused the postback and raise appropriate events on the server. Note To override an EventName event. Perform any final cleanup before Dispose method the control is torn down. For improving efficiency. Process Process incoming form data and postback data update properties accordingly.default implementation of the LoadViewState method to customize state restoration. Generate output to be rendered to Render method the client. Control method) authors generally perform cleanup in Dispose and do not handle this event. the state is restored. The ViewState property of a SaveViewState method control is automatically persisted to a string object after this stage. Load LoadPostData method (if IPostBackDataHandler is implemented) Perform actions common to all Load event requests. At this point. (Session/State) . OnEventName). such as setting up a database query. override the OnEventName method (and call base. a control can override the SaveViewState method to modify the ViewState property. (OnLoad method) server controls in the tree are created and initialized. Perform any updates before the PreRender event output is rendered. Save state Render Dispose Unload 272. Perform any final cleanup before UnLoad event (On UnLoad the control is torn down.

com/quickstart/aspplus/doc/stateoverview. The following sample assumes that the state service is running on the same machine as the Web server ("localhost") and uses the default port (42424): <sessionState mode="StateServer" stateConnectionString="tcpip=localhost:42424" /> Note that if you try the sample above with this setting. The state service will by default listen on port 42424. you can reset the Web server (enter iisreset on the command line) and the session state value will persist. Application_EndRequest. a session can be tracked by adding a session identifier to the URL. What is cookie less session? How it works? By default. Additionally.273. ** . Session events are similar to application events (there is a Session_OnStart and a Session_OnEnd event). just as ASP does.aspx 276. You can create handlers for these types of events in the Global.NET can store session data in an external process. 274.NET page framework provides ways for you to work with events that can be raised when your application starts or stops or when an individual user's session starts or stops: Application events are raised for all requests to an application. Application and Session Events The ASP. A corresponding event.gotdotnet.net session supports cookie less session & it can span across multiple servers. To enable this feature: Start the ASP. which can even reside on another machine. modify the registry key for the service: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\aspnet_state\Par ameters\Port Set the mode attribute of the <sessionState> section to "StateServer". ASP. How you will handle session when deploying application in more than a server? Describe session handling in a webfarm.NET state service. how does it work and what are the limits? By default. This can be enabled by setting the following: <sessionState cookieless="true" /> http://samples. For example. ASP.NET Session? asp. Difference between ASP Session and ASP. but are raised with each unique session within the application. If cookies are not available. A session begins when a user requests a page for the first time from your application and ends either when your application explicitly closes the session or when the session times out. provides you with an opportunity to close or otherwise dispose of resources used for the request. either using the Services snap-in or by executing "net start aspnet_state" on the command line. Application_BeginRequest is raised when any Web Forms page or XML Web service in your application is requested. Configure the stateConnectionString attribute with the values of the machine on which you started aspnet_state. just as ASP does. To change the port. 275. This event allows you to initialize resources that will be used for each request to the application.NET will store the session state in the same process that processes the request.asax file.NET will store the session state in the same process that processes the request. ASP.

since a server control's view state is passed to and from the server in a hidden form field. 281. This feature does impact performance. What method do you use to explicitly kill a users session? Abandon() 278. What are the disadvantages of view state / what are the benefits? Automatic view-state management is a feature of server controls that enables them to repopulate their property values on a round trip (without you having to write any code).277. What is ViewState? What does the "EnableViewState" property do? Why would I want it on or off? ** 285.NET page framework includes various options to help you preserve changes — that is. you can use one of the state management options. you will probably also have application-specific values that you want to preserve. the ASP. for managing state. To do so. In traditional Web programming.e between 1.Net? What is view state? Web pages are recreated each time the page is posted to the server. this would ordinarily mean that all information associated with the page and the controls on the page would be lost with each round trip. what is the impact of Read and Write operation on Session objects? will performance degrade? Maintaining state using database technology is a common practice when storing user-specific information where the information store is large. Client-Based State Management Options: View State Hidden Form Fields Cookies Query Strings Server-Based State Management Options Application State Session State Database Support 280. You should be aware of when view state helps you and when it hinders your page's performance. How do you create a permanent cookie? ** 284. When maintaining session through Sql server. However. 286. Explain the differences between Server-side and Client-side code? Server side code will process at server side & it will send the result to client. Database storage is particularly useful for maintaining long-term state or state that must be preserved even if the server must be restarted. Can you give an example of what might be best suited to place in the Application_Start and Session_Start subroutines? ** . What are the contents of cookie? ** 283.asp to 2.asp)? Session public properties 279. What is State Management in . To overcome this inherent limitation of traditional Web programming. ** 282. What are the different ways you would consider sending data across pages in ASP (i.Net and how many ways are there to maintain a state in . however. The page framework includes a facility called view state that automatically preserves property values of the page and all the controls on it between round trips. Client side code (javascript) will execute only at client side.

How do u deploy your asp.NET environment? 302.net? 297.net ? 298.com/library/default. Briefly describe the role of global.) 293. slidingExpiration="true|false"> 309. <credentials passwordFormat="Clear|SHA1|MD5"> 310. How will you do windows authentication and what is the namespace? If a user is logged under integrated windows authentication mode.NET framework maps client side events to Server side events. performance and stability of the server and. <user name="username" password="password"/> .Net has implemented security for web applications? 296. loginUrl="url" 305. application or subdirectory level on the shared hosting platform. What are the different authentication modes in the . Various steps taken to optimize a web based application (caching.net application? 291. How can u debug your . ** 300. protection="All|None|Encryption|Validation" 306.net application? 292. A principal can be a member of one or more roles. what might be the possible cause for this? In ASP. but he is still not able to logon. therefore cannot be changed.microsoft. Explain autherization levels in . applications can use role membership to determine whether a principal is authorized to perform a requested action.Net application how do you find the name of the logged in person under windows authentication? 301.NET implementation on the shared web hosting platform? A: Many of the ASP. What is Role-Based security? A role is a named set of principals that have the same privileges with respect to security (such as a teller or a manager). Security types in ASP/ASP. How to do Forms authentication in asp.NET? Different Authentication modes? 295. timeout="30" path="/" > 307. The following settings are the only ones that can be changed in your site’s web.net ? 299. How does ASP.287.asp?url=/library/enus/cpguide/html/cpconaspnetconfiguration. Certain options can affect the security.NET configuration options are not configurable at the site.NET configuration options are supported in the ASP.asax? 289. Explain authentication levels in . Therefore.net application? 290. Which ASP.asp 288. requireSSL="true|false" 308.config file (s): browserCaps clientTarget pages customErrors globalization authorization authentication webControls webServices http://msdn. Where do we store our connection string in asp. (Security) 294. <forms name="name" 304. How . stored procedure etc. <authentication mode="Windows|Forms|Passport|None"> 303.

Validation controls perform input checking in server code.311. in ASP. Digest. <passport redirectUrl="internal"/> </authentication> Attribute Option mode Description Controls the default authentication mode for an application. CompareValidator Control. Forms Specifies ASP. How can you debug an ASP page. web page that user name and . CustomValidator Control. How do you implement postback with a text box? What is postback and usestate? Make AutoPostBack property to true 320.css is the name of your external CSS style sheet. Integrated Windows authentication (NTLM/Kerberos). The following validation controls are available in asp. RegularExpressionValidator Control. None Specifies no authentication.NET that test user input in HTML and Web server controls for programmer-defined requirements.NET forms-based authentication as the default authentication mode. What is the other method. What are validator? Name the Validation controls in asp. other than GET and POST. 319.css"> MyStyles.net validators run in server side or client side? How do you do Client-side validation in . </forms> 313. </credentials> 312. Use this mode when using any form of Microsoft Internet Information Services (IIS) authentication: Basic. Many web pages take parameters from web user. 317. and make SQL query to the database. RangeValidator Control.Net? How to disable validator control by client side JavaScript? A set of server controls included with ASP.net? How do u disable them? Will the asp.net: RequiredFieldValidator Control. without touching the code? 321. If the user is working with a browser that supports DHTML. Passport Specifies Microsoft Passport authentication as the default authentication mode. 315. ErrorMessage 318. Take for instance when a user login. How do you use css in asp. Which two properties are there on every validation control? ControlToValidate. Windows Specifies Windows authentication as the default authentication mode. or certificates.net? Within the <HEAD> section of an HTML document that will use these styles. ValidationSummary Control.NET? 316. the validation controls can also perform validation ("EnableClientScript" property set to true/false) using client script. add a link to this external CSS style sheet that follows this form: <LINK REL="STYLESHEET" TYPE="text/css" HREF="MyStyles. 314. What is SQL injection? An SQL injection attack "injects" or manipulates SQL code by adding unexpected SQL to a query. Only anonymous users are expected or applications can handle events to provide their own authentication. How do you specify whether your data should be passed as Query string and Forms (Mainly about POST and GET) Through attribute tag of form tag.

A scenario that two namespaces named N1 and N2 are there both having the same class say A.maintain separate cache entry for header string changes (UserAgent.Net? 323.Nested. How can u handle Exceptions in Asp.Net? 324.Proj. How to do Caching in ASP? A: <%@ OutputCache Duration="60" VaryByParam="None" %> VaryByParam Description value none One version of page cached (only raw GET) * v1 v1. Any alternative to avoid name collisions other then Namespaces. Asp. String ErrMessage.can specify separate cache entries for browser types and version or provide a custom GetVaryByCustomString method in HttpApplicationderived class 327.) VaryByControl . How can u handle Un Managed Code Exceptions in ASP.How to find last error which occurred? A: Server.for user controls. 329.password and make SQL query to the database to check if a user has valid name and password. LastError = Server. etc.using N2. UserLanguage. [C#] Exception LastError.Write("Last Error = " + ErrMessage). maintain separate cache entry for properties of a user control VaryByCustom .net . Username: ' or 1=1 --Password: [Empty] This would execute the following query against the users table: select count(*) from users where userName='' or 1=1 --' and userPass='' 322.age" %> The OutputCache directive supports several other cache varying options VaryByHeader . else ErrMessage = "No Errors".GetLastError().GetLastError(). and i am instantiating class A in this class. What are the page level transaction and class level transaction? 331. Which is the namespace used to write error message in event Log File? 330. if (LastError != null) ErrMessage = LastError. What is the Global ASA(X) File? 328.Message. <%@ OutputCache Duration="60" VaryByParam="none" %> <%@ OutputCache Duration="60" VaryByParam="*" %> <%@ OutputCache Duration="60" VaryByParam="name. now in another class i ve written using N1. What are different transaction options? . Then how will u avoid name collisions? Ans: using alias Eg: using MyAlias = MyCompany. 325. Response.v2 n versions of page cached based on query string and/or POST body n versions of page cached based on value of v1 variable in query string or POST body n versions of page cached based on value of v1 and v2 variables in query string or POST body 326.

. ASP. What is smart navigation? When a page is requested by an Internet Explorer 5 browser.332. and what method must you call in your code.NET configuration files are XML-based text files--each named web. and what are the limitations of any approach you might take in implementing one? 337.aspx 339. persisting the scroll position when moving from page to page.NET configures IIS to prevent direct browser access to web. To double the default timeout of 20 minutes. At run time ASP. 341. persisting element focus between navigations. What are the different modes for the sessionstates in the web.config? ASP.config file of an application: <sessionState timeout="40" /> 340. in order to display data in a Repeater control? How can you provide an alternating color scheme in a Repeater control? What property must you set. SQLServer Indicates that session state is stored on the SQL Server. What is the use of web. smart navigation enhances the user's experience of the page by performing the following: eliminating the flash caused by navigation. What is the difference between application and cache variables? 334.NET automatically watches for file changes and will invalidate the cache if any of the configuration files change).gotdotnet. Each web.NET\Framework\<version>\config\machine. What is the difference between control and component? 335.config--provides default configuration settings for the entire machine.config-that can appear in any directory on an ASP.config file.config file? Off Indicates that session state is not enabled.config configuration files to hierarchically compute a unique collection of settings for each incoming URL target request (these settings are calculated only once and then cached across subsequent requests. you can add the following to the web. Where would you use an IHttpModule. or later.config file applies configuration settings to the directory it is located in and to all virtual child directories beneath it.config file? Configuring session state: Session state features can be configured via the <sessionState> section in a web. StateServer Indicates that session state is stored on a remote server.config? Difference between machine. retaining only the last page state in the browser's history. http://samples. The root configuration file-WinNT\Microsoft. Settings in child directories can optionally override or modify settings specified in parent directories. You ve defined one page_load event in aspx page and same page_load event in code behind how will prog run? 336.config files to ensure that their values cannot become public (attempts to access them will cause ASP.NET to return 403: Access Forbidden). Inproc Indicates that session state is stored locally. in order to bind the data from some data source to the Repeater control? 338. ASP. What is the use of sessionstate tag in the web.NET Web application server.com/quickstart/aspplus/doc/configformat.config and Web. What is the namespace for encryption? 333. Can you edit data in the Repeater control? Which template must you provide.NET uses these web.

UI. There are three main uses of Web services. In what order do the events of an ASPX page execute. and interface descriptions for communication and access. Why Web Services? By exposing data and functionality using standard protocols.NET\Framework\v1. 350. For example. What base class do all Web Forms inherit from? System. As a developer is it important to undertsand these events? 343. Web services typically rely on XML-based protocols. Programs invoking a Web service are called clients.0. . Is it possible for me to change my aspx file extension to some other name? Yes. What is a WebService and what is the underlying protocol used in it? Namespace? Web Services are applications delivered as a service on the Web. What tags do you need to add within the asp:datagrid tags to bind columns manually 345. Enter aspnet_isapi details (C:\WINDOWS\Microsoft. Open IIS->Default Website -> Properties Select HomeDirectory tab Click on configuration button Click on add.aspx file.UI.3705\aspnet_isapi. the dynamically generated class sets this property.HEAD. How can we create pie chart in asp.why would you even do this? 344. 342. a . Web services allow for programmatic access of business logic over the Web. Consider this carefully when deciding whether to set this property to true.NET client running on Windows 2000 can easily invoke a Java Web service running on a mainframe or Unix machine to retrieve data from a legacy application. Doing e-business with Web services means a low barrier to entry because Web services can be added to existing applications running on any platform without changing legacy code. messages. SOAP over HTTP is the most commonly used protocol for invoking Web services. Organizations can send electronic purchase orders to suppliers and receive electronic invoices.NET running in Apache web servers . Commercial Web services focus on selling content and business services to clients over the Internet similar to familiar Web pages.NET\Framework\v1.net? 347. Set the SmartNavigation attribute to true in the @ Page directive in the .Web.Smart navigation is best used with ASP.POST.DEBUG) | Open machine. What is AutoEventWireup attribute for ? (WEBSERVICE & REMOTING) 349. Web services are designed to be used by other programs or applications rather than directly by end user. How would you get ASP.dll GET. When the page is requested.NET pages that require frequent postbacks but with visual content that does not change dramatically on return. Web services make it easy to build sophisticated applications that integrate many features and content.Page 346.config(C:\WINDOWS\Microsoft.PageHandlerFactory"/> 348.3705\CONFIG) & add new extension under <httpHandlers> tag <add verb="*" path="*. Business integration Web services allow trading partners to engage in ebusiness leveraging the existing Internet infrastructure. Application integration Web services within an intranet are commonly used to integrate business applications running on disparate platforms.0.Web.santhosh" type="System.

g. After SOAP became available as a mechanism for exchanging XML messages among enterprises (or among disparate applications within the same enterprise). WSDL. IBM.1. It would be very difficult to get customers to pay you for using a Web service that creates business charts with the customers? data. commercial Web services are valuable only if they expose a valuable service or content. The Universal Description. UDDI and the concept behind Web Services? What are various components of WSDL? What is the use of WSDL. 352. and MIME. UDDI doesn't use the SOAP serialization format because it's not well suited to passing complete XML documents (it's aimed at RPC style interactions). and Ariba. UDDI uses a private agreement profile of SOAP (i. The same XML message can be mapped to multiple operations (or services) and bound to one or more communications protocols (using "ports"). Discovery. In a Webservice. Customers would rather buy a charting component (e. easy to use. which is conceptually patterned after DNS (the Internet service that translates URLs into TCP addresses). SOAP is simple. a better way was needed to describe the messages and how they are exchanged.NET component) and install it on the same machine as their application. and completely neutral with respect to operating system. need to display 10 rows from a table.exe utility? SOAP is an XML-based messaging framework specifically designed for exchanging formatted data across the Internet. programming language. 353. The current WSDL spec describes how to map messages and operations to SOAP 1. but ultimately customers pay for contents and/or business services. COM or . Web Services is just a new way of looking at existing implementation platforms. founded by Microsoft. The WSDL syntax allows both the messages and the operations on the messages to be defined abstractly. Microsoft. Continental Airlines exposes flight schedules and status Web services for travel Web sites and agencies to use in their applications. WSDL defines web services in terms of "endpoints" that operate on XML messages. or transistors. so they can be mapped to multiple physical implementations. developed by Microsoft and IBM for the purpose of defining the XML message. and other businesses search UDDI when they want to discover a trading partner. The information in UDDI is categorized according to industry type and geographical location. What is SOAP. and protocol mapping of a web service accessed using SOAP or other XML protocol. Like Web pages. for example someone from whom they wish to procure sheet metal. Technology can help you add value to your services and explore new markets. Are Web Services a replacement for other distributed computing platforms? No. commercial Web services target applications not humans as their direct users. WSDL creates web service definitions by mapping a group of endpoints into a logical sequence of operations on XML messages. and Ariba also are hosting the initial deployment of a UDDI service. The Web Services Description Language (WSDL) is a particular form of an XML Schema.e. UDDI is an independent consortium of vendors. bolts. for the purpose of developing an Internet standard for web service description registration and discovery. allowing UDDI consumers to search through lists of . not for technology 351. The main idea is that businesses use the SOAP APIs to register themselves with UDDI. HTTP GET/POST. for example using request and reply messages or sending entire documents. IBM.Unlike Web pages. it makes sense to sell real-time weather information or stock quotes as a Web service. and Integration (UDDI) framework defines a data model (in XML) and SOAP APIs for registration and searches on business information. operation. So DataReader or DataSet is best choice? A: WebService will support only DataSet. including the web services a business exposes to the Internet. or distributed computing platform. On the other hand.

potentially matching businesses to find the specific one they want to contact. This proxy class exposes the methods of the XML Web service and handles the marshalling of appropriate arguments back and forth between the XML Web service and your application.microsoft.com/library/default. you just need to create a System. 354. If you need to encrypt the data exchange. asynchronous web service means? 356. these items cannot: Parse a SOAP request for valid values Authenticate access at the Web Method level (they can authenticate at the Web Service level) Stop reading a request as soon as it is recognized as invalid http://msdn. To generate an XML Web service proxy class: From a command prompt. For authentication. use Wsdl. Visual Studio creates an XML Web service proxy class automatically and adds it to your project. you first add a Web reference. The contact information includes a pointer to the target business's WSDL or other XML schema file describing the web service that the target business publishes.ConnectorProperty("UseProxy") = True While with .Net. specifying (at a minimum) the URL to an XML Web service or a service description. How to generate proxy class other than .WebProxy(?http://proxyserver:8080?) 361.Net. you use Secure Sockets Layer (SSL) or a Virtual Private Network to keep the bits secure.asp 362.WebProxy object and use it to set the Proxy property Dim webs As localhost. What is disco file? .ConnectorProperty("ProxyServer") = ?proxyservername? soap. When you create a Web reference.exe to create a proxy class. What is a proxy in web service? How do I use a proxy server when invoking a Web service? If you are using the SOAP Toolkit..NET . things that you do to secure a Web site can be used to secure a Web Service. another call to UDDI is made to obtain the specific contact information for that business. What are the different formatters can be used in both? Why?.ConnectorProperty("ProxyPort") = ?8080? soap.asp?url=/library/enus/cpguide/html/cpcontransactionsupportinaspnetwebservices. How will do transaction in Web Services? 359. Wsdl /language:language /protocol:protocol /namespace:myNameSpace /out:filename /username:username /password:password /domain:domain <url or path> 355. What’s the attribute for webservice method? What is the namespace for creating webservice? 364. which is a reference to an XML Web service. use HTTP Basic or Digest authentication with Microsoft® Windows® integration to figure out who the caller is.Proxy=New System. Once a specific business is chosen. binary/soap 360. or the path to a saved service description.net app and wsdl tool? To access an XML Web service from a client application. Visual Studio uses the Web Services Description Language (WSDL) to create the proxy. How will you expose/publish a webservice? 363. How you will protect / secure a web service? For the most part. you need to set some connector properties to use a proxy server: Dim soap As SoapClient Set soap=New SoapClient soap.MyService() webs. What are the events fired when web service called? 357. How does SOAP transport happen and what is the role of HTTP in it? How you can access a webservice using soap? 358.

Using binary communication.NET remoting requires the client be built using .NET platform.NET remoting framework. As explained before. Though both the . regardless of whether they are on the same computer.NET Remoting can provide support for rich type system . If you are going to go cross-platform or you have the requirement of supporting SOAP via HTTP. application needs to provide plumbing for ensuring the reliability of the application. and between different contexts.NET Web services can enable cross-process communication. you should go for this channel. enforcing homogenous environment.NET Remoting Can be accessed over any protocol Can be accessed only over HTTP (including TCP. Ease-ofProgramming 367.NET Remoting infrastructure and ASP. whether on the same computer or not.365.NET remoting and ASP.NET remoting system is an architecture designed to simplify communication between objects living in different application domains. 366. whether in the same application domain or not.NET Remoting provides a more complex programming model and has a much narrower reach. and are ideal for heterogeneous environments. stages. ASP. HTTP. Easy-to-create and deploy. .NET Web services provide a simple programming model and a wide reach.NET Web Services Protocol State Management .NET Web services. It is important to understand how both technologies work and then choose the one that is right for your application. . If you can create direct TCP connections from your clients to your server and if you need to support only the .NET. The .NET components and . Highly reliable due to the fact that Web services are always hosted in IIS Reliability Extensibility Provides extensibility by allowing us to intercept the Very extensible by allowing us to SOAP messages during the customize the different components serialization and deserialization of the . Difference between web services & remoting? ASP. Can also take advantage of IIS for fault isolation. For those that require communications with other . the clear performance advantage provided by TCPChannel-remoting should make you think about using this channel whenever you can afford to do so. limiting the number of objects that can be serialized. Complex to program. What is Remoting? The process of communication between different operating system processes.NET Web services are powerful technologies that provide a suitable framework for developing distributed applications. For applications that require interoperability and must function over public networks. Both the . you should definitely go for ASP. SMTP and so on) Provide support for both stateful and Web services work in a stateless stateless environments through environment Singleton and SingleCall objects Web services support only the datatypes defined in the XSD type system. Web services are probably the best bet. Type System Web services support interoperability across Interoperability platforms. each is designed to benefit a different target audience. If IIS is not used.

NET webservices and . 377. What is XPath Query ? 385.NET Remoting when sending and receiving data between . (In SAO the object is instantiated when the client calls the method on the object) 370. 371. Difference Between Element and Node. How to generate WebService proxy? 373. 368. singleton and singlecall. This is in direct contrast to SAO. ASP.NET uses XML serializer for serializing or Marshalling.NET Remoting is the best choice. What is GetElementbyname method will do? 389. And XSD is used for Metadata. What are the ways to create a tree view control using XML. Singleton types never have more than one instance at any one time.NET Remoting relies on System. In some architectural scenarios.XML Namespace? 379. What is “Well Formed XML” and “Valid XML” 381. Web Client class and its methods? 374. and the other classes in System. XSL & JavaScript? 378. Questions on XPathNavigator. If an instance exists.Runtime. all client requests are serviced by that instance. CAO and SAO. use .NET applications.NET CLR Runtime assemblies for metadata. Unlike as SAO a CAO doesn’t delay the object creation until the first method is called on the object. What is valid xml document? What a well formed xml document? . . 383. What is Asynchronous Web Services? 372. In short. What is CDATA Section. Flow of remoting? (XML) 375. Can we do sorting in XSL ? how do you deal sorting columns dynamically in XML. Client activated objects are instantiated on the server as soon as the client request the object to be created. DOM & SAX parsers explanation and difference 388.Formatter. Explain the concept of data island? 376. 386. What is selectnode method will give? 390.Binary and System. What is “Async” property of XML Means ? 384. Where the server. Single Call types always have one instance per client request. The next method invocation will be serviced by a different server instance.NET Remoting is how they serialize data into messages and the format they choose for metadata.NET Web services and take advantage of the best of both worlds.Serialization. not the client has complete control over the lifetime of the objects. Can you pass SOAP messages through remoting? 369. .where performance is a key priority. use Web services when you need to send and receive data from different computing platforms.NET Remoting in conjunction with ASP.SOAPFormatter and relies on . Client Activated objects are those remote objects whose Lifetime is directly Controlled by the client. The Key difference between ASP. What is Use of Template in XSL? 380.Serialization. How to use XML DOM model on client side using JavaScript. even if the previous instance has not yet been recycled by the system. you might also be able to use. How you will do SubString in XSL 382. 387.Runtime.

399. xmlns:diffgr="urn:schemas-microsoft-com:xmldiffgram-v1" 397. When sending and retrieving a DataSet from an XML Web service. <diffgr:before> This block of the DiffGram format contains the original version of a row. <diffgr:errors> This block of the DiffGram format contains error information for a particular row in the DataInstance block.org/2001/XMLSchema"> <diffgr:errors> </diffgr:errors> </diffgr:diffgram> The DiffGram format consists of the following blocks of data: <DataInstance> The name of this element. whether it has been modified or not. A DataInstance element represents a DataSet or a row of a DataTable. 403. Elements in this block are matched to elements in the DataInstance block using the diffgr:id annotation. Explain what a DiffGram is. 406. 402. When a DataSet is written as a DiffGram. though not the schema. row error information.391. or row. 401. and a good use for one? A DiffGram is an XML format that is used to identify current and original versions of data elements. <DataInstance> </DataInstance> <diffgr:before> </diffgr:before> 407. and an errors section.w3. the DiffGram format is implicitly used. and to serialize its contents for transport across a network connection. What is the Difference between XmlDocument and XmlDataDocument? 392. <?xml version="1. it populates the DiffGram with all the necessary information to accurately recreate the contents. 405. DiffGram Format The DiffGram format is divided into three sections: the current data. <diffgr:diffgram 395. as shown in the following example. Write syntax to serialize class using XML Serializer? (IIS) . 404. xmlns:xsd="http://www. including column values from both the Original and Current row versions. Elements in this block are matched to elements in the DataInstance block using the diffgr:id annotation. that has been modified is identified with the diffgr:hasChanges annotation. the original (or "before") data. This block of the DiffGram format contains the current data. xmlns:msdata="urn:schemas-microsoft-com:xmlmsdata" 396. the element would contain the name of the DataSet or DataTable. 393. An element. and row order. DataInstance. 398. If I replace my Sqlserver with XML files and how about handling the same? 408. 400.0"?> 394. is used for explanation purposes in this documentation. of the DataSet. Instead of DataInstance. The DataSet uses the DiffGram format to load and persist its contents.

this method is. password and domain name to log on the user using a local logon. it does not actually provide a password to Windows. This makes Basic authentication the wrong choice to use over a public network on its own. When IIS does not control the password. namely RFC 2069 (superceded by RFC 2617). they are transmitted using Base64 encoding. With SSL to shelter the security credentials while they are in transmission. which is trivially easy to decode. The function of this DLL is to validate the password supplied by IIS and to inform Windows that the password is valid. you have an authentication solution that is both highly secure and quite flexible. It achieves this greater security not by encrypting the secret (the password) before sending it. Digest authentication also uses a challenge/response model. As the specification makes clear.dll) authenticates the user using a network logon. By default.NET requests among other things. whereas a network logon does not. it is not technically performing any client authentication because the client is not required to supply any credentials.NET request is received (usually a file with .dll takes care of it by passing the request to the actual worker process aspnet_wp. but rather by following a different design pattern -. or even against accounts on the local machine. the ISAPI filter aspnet_isapi. The reason is that Basic authentication assumes a trusted connection between client and server. Thus.0 and Explain? Difference between basic and digest authentication modes? IIS provides a variety of authentication schemes: Anonymous (enabled by default) Basic Digest Integrated Windows authentication (enabled by default) Client Certificate Mapping Anonymous Anonymous authentication gives users access to the public areas of your Web site without prompting them for a user name or password. IIS caches the security token and impersonates the account. When an ASP.exe is the Microsoft IIS server running.users can authenticate against any NT domain. Basic Authentication is a long-standing standard supported by nearly all browsers. Although listed as an authentication scheme. A local logon makes it possible for the anonymous user to access network resources. IIS calls the LogonUser() API in Windows and provides the account name. Instead.exe. In which process does IIS runs (was asking about the EXE file) inetinfo. thereby authenticating the client.one that does not require the client to transmit the password over the wire at all. in and of itself.0 specification. After the logon. Like Basic authentication.aspx extension). . However. Basic Authentication IIS Basic authentication as an implementation of the basic authentication scheme found in section 11 of the HTTP 1. IIS controls the password for this account. More specifically. IIS provides stored credentials to Windows using a special user account.0. but it is much more secure than Basic authentication (when used without SSL). Whether or not IIS controls the password affects the permissions the anonymous user has. the username and password are transmitted in clear text. handling ASP. this is an implementation of a technique suggested by Web standards. Where are the IIS log files stored? C:\WINDOWS\system32\Logfiles\W3SVC1 OR c:\winnt\system32\LogFiles\W3SVC1 411. a sub authentication DLL (iissuba. Digest Authentication The Digest authentication option was added in Windows 2000 and IIS 5.409. What are the different IIS authentication modes in IIS 5. It also imposes no special requirements on the server side -. When IIS controls the password. IUSR_machinename. 410. non-secure.

(If you have ever wondered what the default ISAPI filter "md5filt" that is installed with IIS 5.asp 412. IIS5 supports three isolation levels. How to configure the sites in Web server (IIS)? 413. mspx http://www.Instead of sending the password itself. that you can set from the Home Directory tab of the site's Properties dialog: .509 certificate includes the format of the certificate. even though the password itself was never sent.509 client certificates simplify authentication for larger user bases because they do not rely on a centralized account database. Instead. Integrated Windows authentication. the server knows that the client knows the correct password. the serial number of the certificate.com/technet/treeview/default.0 and later) are running Windows 2000 and later. and both are members of the same domain or trusted domains. If they match. the algorithm used to sign the certificate. the client transmits a one-way message digest (a checksum) of the user's password. the name and public key of the entity requesting the certificate. When Internet Explorer attempts to access a protected resource. At the server. Integrated Windows authentication is the best authentication scheme in an intranet environment where users have Windows domain accounts. The server then fetches the password for that user from a Windows 2000 Domain Controller. thus binding these two pieces of information together. If Internet Explorer recognizes the Negotiate header. If Internet Explorer does not understand Negotiate. it will use NTLM. When using Negotiate.com/windowsserver2003/iis/evaluation/features/default.0? http://www. the server will default to using NTLM.0 and later) and server (IIS 5. A trusted organization (or entity) called a Certification Authority (CA) issues a certificate after the CA verifies that the entity is who it says it is.0 and later. So.microsoft. Certificates can contain different types of data. Otherwise.asp?url=/library/enus/vsent7/html/vxconIISAuthentication. does not pass the user's password across the network. X. For example. especially when using Kerberos. Client Certificate Mapping A certificate is a digitally signed statement that contains information about an entity and the entity's public key. Delegation enables remote access of resources on behalf of the delegated user. like digest authentication. a hashed value is exchanged. now you know. it will choose it because it is listed first. and the CA's signature. http://msdn. which is also present in IIS4 under a different name. and compares the two digests. using (by default) the MD5 algorithm. Negotiate and NTLM. the browser will return information for both NTLM and Kerberos.microsoft. the name of the CA that issued the certificate.0 is used for. an X. IIS can delegate security credentials among computers running Windows 2000 and later that are trusted and configured for delegation. Integrated Windows Authentication Integrated Windows authentication (formerly known as NTLM authentication and Windows NT Challenge/Response authentication) can use either NTLM or Kerberos V5 authentication and only works with Internet Explorer 2. reruns the checksum algorithm on it.asp 414. which mechanism is used depends upon a negotiation between Internet Explorer and IIS.microsoft. IIS sends two WWWAuthenticate headers. You can verify a certificate simply by examining the certificate. IIS Isolation Levels? Internet Information Server introduced the notion "Isolation Level". When used in conjunction with Kerberos v5 authentication. IIS will use Kerberos if both the client (Internet Explorer 5.com/library/default. Advantages in IIS 6.asp?url=/technet/prodtec hnol/windowsserver2003/proddocs/datacenter/gs_whatschanged.

NET page. so you can have a web site running with just two processes (IIS and ASP process). which makes this setting more reliable: if ASP crashes IIS won't.Web. The problem is that if ASP crashes.HtmlInputFile class and the System. How to implement DataGrid in .Web.Low (IIS Process): ASP pages run in INetInfo. Write a program to find the angle between the hours and minutes in a clock 420. therefore if an ASP application crashes. IIS5 is the first Internet Information Server version that supports this setting. keep in mind that outprocess settings . Therefore. How can we create Tree control in asp.NET page? A: In order to perform file upload in your ASP. The downside is that you consume more memory and resources if the server hosts many ASP applications. Both IIS4 and IIS5 supports this setting: under IIS4 this process runs inside MTS.HttpPostedFile class. remember that the /data directory is the only directory with Write permissions enabled for the anonymous user. Medium (Pooled): In this case ASP runs in a different process.net? Programming 418. and is the default under IIS4. so it's hosted in DLLHOST. Note that an ASP application that runs at this level is run under COM+. The HttpPostedFile class represents the uploaded file and is obtained from the PostedFile property of the HtmlInputFile class. In order to use the HtmlInputFile control. However.HtmlControls. This is the fastest setting. How do I upload a file from my ASP.NET? How would u make a combo-box appear in one column of a DataGrid? What are the ways to show data grid inside a data grid for a master details type of tables? If we write any code for DataGrid methods. The HtmlInputFile class represents and HTML input control that the user will use on the client side to select a file to upload. How will you do Redo and Undo in a TextControl? 416. Controls 415. In practice. the main IIS process. which is also the default setting when you create an IIS5 application.that is. All the ASP applications at the Medium isolation level share the same process. you need to add the enctype attribute to your form tag as follows: <form id="upload" method="post" runat="server" enctype="multipart/formdata"> Also.are less efficient than in-process (Low). Write a C# program to find the Factorial of n 421.UI. you shouldn't set the Low isolation level for an IIS5 application unless you really need to serve hundreds pages per second. therefore they are executed in-process. you will need to make sure that the your code uploads the file to the /data directory or one of its . while under IIS5 it runs inside DLLHOST. you will need to use two classes: the System.Exe. out-process communication has been vastly improved under IIS5.EXE. Medium and High . When selecting an isolation level for your ASP application.EXE. what is the access specifier used for that methods in the code behind file and why? 417.EXE (and you can see this executable in the Task Manager). and in fact IIS5's Medium isolation level often deliver better results than IIS4's Low isolation. Write a program in C# for checking a given number is PRIME or not. IIS crashes as well and must be restarted (IIS5 has a reliable restart feature that automatically restarts a server when a fatal error occurs). 419. High (Isolated): Each ASP application runs out-process in its own process space. neither IIS nor any other ASP application will be affected.

Below is a simple example of how to upload a file via an ASP. lblFileName.Controls. strFileName = loFile.Server. strFileNamePath.PostedFile.ContentType.UI. strFileName = Path.Red.ContentLength.SaveAs(strFileNamePath). EventArgs e) { if (loFile.PostedFile. strFileNamePath = strFileFolder + strFileName. loFile.Drawing" %> <html> <head> <title>upload_cs</title> </head> <script language="C#" runat="server"> public void UploadFile(object sender.ForeColor = Color.Text = loFile.Add(lblError).subdirectories.Web.PostedFile.HtmlControls" %> <%@ Import Namespace="System. lblFileType.Message.Visible = true. lblFileLength.Visible = true.MapPath(@"data\").ToString().NET page in C# and VB.GetFileName(strFileName). this. lblError.Text = loFile. C# <%@ Import Namespace="System" %> <%@ Import Namespace="System.FileName. strFileFolder. pnStatus.PostedFile.IO" %> <%@ Import Namespace="System.Text = "Exception occurred: " + x.PostedFile != null) { try { string strFileName.NET. lblError. } } } </script> <body> <form id="upload_cs" method="post" runat="server" enctype="multipart/form-data"> <P> <INPUT type="file" id="loFile" runat="server"> </P> <P> <asp:Button id="btnUpload" runat="server" Text=" Upload " OnClick="UploadFile"></asp:Button></P> <P> <asp:Panel id="pnStatus" runat="server" Visible="False"> <asp:Label id="lblFileName" Font-Bold="True" Runat="server"></asp:Label> uploaded<BR> <asp:Label id="lblFileLength" Runat="server"></asp:Label> bytes<BR> <asp:Label id="lblFileType" Runat="server"></asp:Label> </asp:Panel></P> </form> .Web" %> <%@ Import Namespace="System. lblError.Text = strFileName. strFileFolder = Context. } catch (Exception x) { Label lblError = new Label().

mailObj.Web. mailObj.Message). } } </script> <body> <form id="mail_test" method="post" runat="server"> </form> </body> </HTML> 423.Body = "Your order was processed. In order to send mail through our mail server. Below is a simple example of using this class to send mail in C# and VB.Write("Your message was not sent: " + x.Mail" %> <HTML> <HEAD> <title>Mail Test</title> </HEAD> <script language="C#" runat="server"> private void Page_Load(Object sender. (Hint use event delegates) .NET page? A: You can use the System. SmtpMail.From = "sales@joeswidgets. EventArgs e) { try { MailMessage mailObj = new MailMessage().SmtpServer = "mail-fwd".</body> </html> 422. mailObj.Web" %> <%@ Import Namespace="System. How do I send an email message from my ASP.Write("Mail sent successfully").BodyFormat = MailFormat. Response.Mail.SmtpMail class to send email in your ASPX pages.Text. C# <%@ Import Namespace="System" %> <%@ Import Namespace="System.Mail. you would want to make sure to set the static SmtpServer property of the SmtpMail class to mail-fwd. mailObj.NET. SmtpMail.Web.To = "ringleader@forexample-domain. mailObj.".MailMessage and the System.com".com". } catch (Exception x) { Response.Web. Write a program to create a user control with name and surname as data members and login as method and also the code to call it.Send(mailObj).Subject = "Your Widget Order".

Master your semester with Scribd & The New York Times

Special offer for students: Only $4.99/month.

Master your semester with Scribd & The New York Times

Cancel anytime.