<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1819512445879631740</id><updated>2024-09-06T17:35:47.920-07:00</updated><category term="C#3.0"/><category term="# serialization"/><category term="Concordance"/><title type='text'>Welcome to Naresh Guduri Blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://gudurin.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1819512445879631740/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://gudurin.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Naresh Guduri Blog</name><uri>http://www.blogger.com/profile/02461913656830998473</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>17</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1819512445879631740.post-6131323296362852496</id><published>2009-09-26T19:10:00.000-07:00</published><updated>2009-09-26T19:11:05.884-07:00</updated><title type='text'>Funny asking Increment Letter to BOSS</title><content type='html'>How to ask your Boss for a salary increase? &lt;br /&gt;&lt;br /&gt;One day an employee sends a letter to H er boss asking for an increase in her salary!!! &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Dear Bo$$&lt;br /&gt;&lt;br /&gt;In thi$ life, we all need$ ome thing mo$ t de$ perately. I think you$hould be under $ tanding of the need $ of u $ worker $ who have given$o much $ upport including $ weat and $ ervice to your company. &lt;br /&gt;&lt;br /&gt;I am$ure you will gue$$ what I mean and re $ pond $oon. &lt;br /&gt;&lt;br /&gt;Your$ $incerely, &lt;br /&gt;&lt;br /&gt;Je$$y &lt;br /&gt;&lt;br /&gt;The next day, the employee received this letter of reply : &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Dear Jessy &lt;br /&gt;&lt;br /&gt;I kNO w you have been working very hard.NO wadays,NOthing much has changed. &lt;br /&gt;You must have NOticed that our company isNO t doing NOticeably well as yet . &lt;br /&gt;NOw the newspaper are saying the world`s leading eco NOmists are NOt sure if the United States may go into a NO ther recession. After theNOvember presidential elections things may turn bad . &lt;br /&gt;I haveNOthing more to add NO w. You kNOw what I mean.</content><link rel='replies' type='application/atom+xml' href='http://gudurin.blogspot.com/feeds/6131323296362852496/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1819512445879631740/6131323296362852496' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1819512445879631740/posts/default/6131323296362852496'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1819512445879631740/posts/default/6131323296362852496'/><link rel='alternate' type='text/html' href='http://gudurin.blogspot.com/2009/09/funny-asking-increment-letter-to-boss.html' title='Funny asking Increment Letter to BOSS'/><author><name>Naresh Guduri Blog</name><uri>http://www.blogger.com/profile/02461913656830998473</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1819512445879631740.post-1367915440072983443</id><published>2009-09-25T09:07:00.000-07:00</published><updated>2009-09-25T09:08:20.057-07:00</updated><title type='text'>.NET FRAMEWORK , SQL C# Questions</title><content type='html'>.NET FRAMEWORK&lt;br /&gt;1. What is .Net?&lt;br /&gt;.Net is Microsoft’s strategy of combining information, people, systems, and devises through software.  Integrated across the Microsoft platform, .Net technologies provide ability to quickly build, deploy, manage, and use connected and security enhanced services.&lt;br /&gt;&lt;br /&gt;2. What Are Web Services?&lt;br /&gt;If you ask a developer what Web services are, you&#39;ll hear something like, &quot;self-describing software modules, semantically encapsulating discrete functionality, wrapped in and accessible via standard Internet communication protocols like XML and SOAP.&quot;&lt;br /&gt;&lt;br /&gt;3. What is .NET Framework?&lt;br /&gt;A programming infrastructure created by Microsoft for building, deploying, and running applications and services that use .NET technologies, such as desktop applications and Web services. The .NET Framework contains three major parts: the Common Language Runtime (CLR), the Framework Class Library, and ASP.NET.&lt;br /&gt;&lt;br /&gt;4. What is CLR&lt;br /&gt;The core runtime engine in the Microsoft .NET Framework for executing applications. The common language runtime supplies managed code with services such as cross-language integration, code access security, object lifetime management, and debugging and profiling support.&lt;br /&gt;&lt;br /&gt;5. 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&#39;s support for cross-language integration.&lt;br /&gt;&lt;br /&gt;6. What is the CLS? CLS = Common Language Specification. This is a subset of the CTS, which all .NET languages are expected to support. The idea is that any program which uses CLS-compliant types can interoperate with any .NET program written in any language.&lt;br /&gt;&lt;br /&gt;7. What are the new features of Framework 1.1 ? &lt;br /&gt;Native Support for Developing Mobile Web Applications &lt;br /&gt;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. &lt;br /&gt;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. &lt;br /&gt;Native Support for Communicating with ODBC and Oracle Databases &lt;br /&gt;Unified Programming Model for Smart Client Application Development&lt;br /&gt;The Microsoft .NET Compact Framework brings the CLR, Windows Forms controls, and other .NET Framework features to small devices. The .NET Compact Framework supports a large subset of the .NET Framework class library optimized for small devices. &lt;br /&gt;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. &lt;br /&gt;&lt;br /&gt;8. Is .NET a runtime service or a development platform?&lt;br /&gt;It&#39;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. &lt;br /&gt;&lt;br /&gt;9 What is MSIL, IL? Microsoft Intermediate Language&lt;br /&gt;the CPU-independent instruction set that is generated by the Microsoft .NET Framework compilers and consumed by the .NET Framework&#39;s common language runtime. Before MSIL can be executed, it must be converted to native, CPU-specific code by the common language runtime.&lt;br /&gt;&lt;br /&gt;10. Can I write IL programs directly?&lt;br /&gt;Yes. &lt;br /&gt;&lt;br /&gt;11. Can I do things in IL that I can&#39;t do in C#?&lt;br /&gt;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.&lt;br /&gt;&lt;br /&gt;12. What is JIT (just in time)? how it works?&lt;br /&gt;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.&lt;br /&gt;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. &lt;br /&gt;&lt;br /&gt;13. What is strong name?&lt;br /&gt;A name that consists of an assembly&#39;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.&lt;br /&gt;&lt;br /&gt;14. What is portable executable (PE)?&lt;br /&gt;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.&lt;br /&gt;&lt;br /&gt;15. What is Event - Delegate? Clear syntax for writing an event delegate&lt;br /&gt;The event keyword lets you specify a delegate that will be called upon the occurrence of some &quot;event&quot; in your code. The delegate can have one or more associated methods that will be called when your code indicates that the event has occurred. An event in one program can be made available to other programs that target the .NET Framework Common Language Runtime.&lt;br /&gt;&lt;br /&gt;16. What is Code Access Security (CAS)?&lt;br /&gt;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. &lt;br /&gt;&lt;br /&gt;17. How does CAS work? &lt;br /&gt;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 &#39;Zone - Internet&#39; code group, which adheres to the permissions defined by the &#39;Internet&#39; named permission set. (Naturally the &#39;Internet&#39; named permission set represents a very restrictive range of permissions.) &lt;br /&gt;&lt;br /&gt;18. Who defines the CAS code groups? &lt;br /&gt;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 &#39;caspol -lg&#39; from the command-line. &lt;br /&gt;&lt;br /&gt;19. How do I define my own code group? &lt;br /&gt;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 sub-group of the &#39;Zone - Internet&#39; 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 &lt;br /&gt;&lt;br /&gt;20. How do I change the permission set for a code group? &lt;br /&gt;Use caspol. If you are the machine administrator, you can operate at the &#39;machine&#39; 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. &lt;br /&gt;&lt;br /&gt;21. Can I create my own permission set?&lt;br /&gt;Yes. Use caspol -ap, specifying an XML file containing the permissions in the permission set.&lt;br /&gt;&lt;br /&gt;22. I&#39;m having some trouble with CAS. How can I diagnose my problem? &lt;br /&gt;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. &lt;br /&gt;&lt;br /&gt;23. I can&#39;t be bothered with all this CAS stuff. Can I turn it off? &lt;br /&gt;Yes, as long as you are an administrator. Just run: caspol -s &lt;br /&gt;&lt;br /&gt;24. Which namespace is the base class for .net Class library? System.object&lt;br /&gt;&lt;br /&gt;25. What are object pooling and connection pooling and difference? Where do we set the Min and Max Pool size for connection pooling?&lt;br /&gt;Object pooling is a COM+ service that enables you to reduce the overhead of creating each object from scratch. When an object is activated, it is pulled from the pool. When the object is deactivated, it is placed back into the pool to await the next request. You can configure object pooling by applying the ObjectPoolingAttribute attribute to a class that derives from the System.EnterpriseServices.ServicedComponent class. Object pooling lets you control the number of connections you use, as opposed to connection pooling, where you control the maximum number reached.&lt;br /&gt;Connection Pooling enables an application to use a connection from a pool of connections that do not need to be re-established for each use. Once a connection has been created and placed in a pool, an application can reuse that connection without performing the complete connection process. When a user request a connection, it is returned from the pool rather than establishing new connection and, when a user releases a connection, it is returned to the pool rather than being released.&lt;br /&gt;Following are important differences between object pooling and connection pooling: &lt;br /&gt;Creation. When using connection pooling, creation is on the same thread, so if there is nothing in the pool, a connection is created on your behalf. With object pooling, the pool might decide to create a new object. However, if you have already reached your maximum, it instead gives you the next available object. This is crucial behavior when it takes a long time to create an object, but you do not use it for very long.&lt;br /&gt;Enforcement of minimums and maximums This is not done in connection pooling. The maximum value in object pooling is very important when trying to scale your application. You might need to multiplex thousands of requests to just a few objects. (TPC/C benchmarks rely on this.)  COM+ object pooling is identical to what is used in .NET Framework managed SQL Client connection pooling. For example, creation is on a different thread and minimums and maximums are enforced.&lt;br /&gt;&lt;br /&gt;26. What is Application Domain?&lt;br /&gt;The primary purpose of the AppDomain is to isolate an application from other applications. Win32 processes provide isolation by having distinct memory address spaces. This is effective, but it is expensive and doesn&#39;t scale well. The .NET runtime enforces AppDomain isolation by keeping control over the use of memory - all memory in the AppDomain is managed by the .NET runtime, so the runtime can ensure that AppDomains do not access each other&#39;s memory. Objects in different application domains communicate either by transporting copies of objects across application domain boundaries, or by using a proxy to exchange messages.&lt;br /&gt;MarshalByRefObject is the base class for objects that communicate across application domain boundaries by exchanging messages using a proxy. Objects that do not inherit from MarshalByRefObject are implicitly marshal by value. When a remote application references a marshal by value object, a copy of the object is passed across application domain boundaries.&lt;br /&gt;&lt;br /&gt;27. How does an AppDomain get created? &lt;br /&gt;AppDomains are usually created by hosts. Examples of hosts are the Windows Shell, ASP.NET and IE. When you run a .NET application from the command-line, the host is the Shell. The Shell creates a new AppDomain for every application.&lt;br /&gt;&lt;br /&gt;28. What is serialization in .NET? What are the ways to control serialization?&lt;br /&gt;Serialization is the process of converting an object into a stream of bytes. Deserialization is the opposite process of creating an object from a stream of bytes. Serialization/Deserialization is mostly used to transport objects (e.g. during remoting), or to persist objects (e.g. to a file or database). Serialization can be defined as the process of storing the state of an object to a storage medium. During this process, the public and private fields of the object and the name of the class, including the assembly containing the class, are converted to a stream of bytes, which is then written to a data stream. When the object is subsequently deserialized, an exact clone of the original object is created. &lt;br /&gt;Types of Serialization&lt;br /&gt;Binary serialization preserves type fidelity, which is useful for preserving the state of an object between different invocations of an application. For example, you can share an object between different applications by serializing it to the clipboard. You can serialize an object to a stream, disk, memory, over the network, and so forth. Remoting uses serialization to pass objects &quot;by value&quot; from one computer or application domain to another. &lt;br /&gt;XML serialization serializes only public properties and fields and does not preserve type fidelity. 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, it is an attractive choice for sharing data across the Web. SOAP is an open standard, which makes it an attractive choice. There are two separate mechanisms provided by the .NET class library - XmlSerializer and SoapFormatter/BinaryFormatter. Microsoft uses XmlSerializer for Web Service, and uses SoapFormatter/BinaryFormatter for remoting. Both are available for use in your own code.&lt;br /&gt;&lt;br /&gt;29. Why do I get errors when I try to serialize a Hashtable?&lt;br /&gt;XmlSerializer will refuse to serialize instances of any class that implements IDictionary, e.g. Hashtable. SoapFormatter and BinaryFormatter do not have this restriction. &lt;br /&gt;&lt;br /&gt;30. What is exception handling?&lt;br /&gt;An exception handler is a piece of code, which will be called when an exception occurs. When an exception occurs, the system searches for the nearest catch clause that can handle the exception, as determined by the run-time type of the exception. First, the current method is searched for a lexically enclosing try statement, and the associated catch clauses of the try statement are considered in order. If that fails, the method that called the current method is searched for a lexically enclosing try statement that encloses the point of the call to the current method. This search continues until a catch clause is found that can handle the current exception, by naming an exception class that is of the same class, or a base class, of the run-time type of the exception being thrown. A catch clause that doesn&#39;t name an exception class can handle any exception. Once a matching catch clause is found, the system prepares to transfer control to the first statement of the catch clause. Before execution of the catch clause begins, the system first executes, in order, any finally clauses that were associated with try statements more nested that than the one that caught the exception. Exceptions that occur during destructor execution are worth special mention. If an exception occurs during destructor execution, and that exception is not caught, then the execution of that destructor is terminated and the destructor of the base class (if any) is called. If there is no base class (as in the case of the object type) or if there is no base class destructor, then the exception is discarded.&lt;br /&gt;&lt;br /&gt;31. What is Assembly?&lt;br /&gt;Assemblies are the building blocks of .NET Framework applications; they form the fundamental unit of deployment, version control, reuse, activation scoping, and security permissions. An assembly is a collection of types and resources that are built to work together and form a logical unit of functionality. An assembly provides the common language runtime with the information it needs to be aware of type implementations. To the runtime, a type does not exist outside the context of an assembly.&lt;br /&gt;Assemblies are a fundamental part of programming with the .NET Framework. An assembly performs the following functions:&lt;br /&gt;It contains code that the common language runtime executes. Microsoft intermediate language (MSIL) code in a portable executable (PE) file will not be executed if it does not have an associated assembly manifest. Note that each assembly can have only one entry point (that is, DllMain, WinMain, or Main). &lt;br /&gt;It forms a security boundary. An assembly is the unit at which permissions are requested and granted. &lt;br /&gt;It forms a type boundary. Every type&#39;s identity includes the name of the assembly in which it resides. 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.&lt;br /&gt;It forms a reference scope boundary. The assembly&#39;s manifest contains assembly metadata that is used for resolving types and satisfying resource requests. It specifies the types and resources that are exposed outside the assembly. The manifest also enumerates other assemblies on which it depends.&lt;br /&gt;It forms a version boundary. The assembly is the smallest versionable unit in the common language runtime; all types and resources in the same assembly are versioned as a unit. The assembly&#39;s manifest describes the version dependencies you specify for any dependent assemblies.&lt;br /&gt;It forms a deployment unit. When an application starts, only the assemblies that the application initially calls must be present. Other assemblies, such as localization resources or assemblies containing utility classes, can be retrieved on demand. This allows applications to be kept simple and thin when first downloaded.&lt;br /&gt;It is the unit at which side-by-side execution is supported. &lt;br /&gt;Assemblies can be static or dynamic. Static assemblies can include .NET Framework types (interfaces and classes), as well as resources for the assembly (bitmaps, JPEG files, resource files, and so on). Static assemblies are stored on disk in PE files. You can also use the .NET Framework to create dynamic assemblies, which are run directly from memory and are not saved to disk before execution. You can save dynamic assemblies to disk after they have executed.&lt;br /&gt;There are several ways to create assemblies. You can use development tools, such as Visual Studio .NET, that you have used in the past to create .dll or .exe files. You can use tools provided in the .NET Framework SDK to create assemblies with modules created in other development environments. You can also use common language runtime APIs, such as Reflection.Emit, to create dynamic assemblies. &lt;br /&gt;&lt;br /&gt;32. What are the contents of assembly?&lt;br /&gt;In general, a static assembly can consist of four elements: &lt;br /&gt;The assembly manifest, which contains assembly metadata. &lt;br /&gt;Type metadata. &lt;br /&gt;Microsoft intermediate language (MSIL) code that implements the types. &lt;br /&gt;A set of resources.&lt;br /&gt;&lt;br /&gt;33. What are the different types of assemblies?&lt;br /&gt;Private, Public/Shared, Satellite&lt;br /&gt;&lt;br /&gt;34. What is the difference between a private assembly and a shared assembly?&lt;br /&gt;Location and visibility: A private assembly is normally used by a single application, and is stored in the application&#39;s directory, or a sub-directory beneath. A shared assembly is normally stored in the global assembly cache, which is a repository of assemblies maintained by the .NET runtime. Shared assemblies are usually libraries of code which many applications will find useful, e.g. the .NET framework classes.&lt;br /&gt;Versioning: The runtime enforces versioning constraints only on shared assemblies, not on private assemblies.&lt;br /&gt;&lt;br /&gt;35. What are Satellite Assemblies? How you will create this? How will you get the different language strings?&lt;br /&gt;Satellite assemblies are often used to deploy language-specific resources for an application. These language-specific assemblies work in side-by-side execution because the application has a separate product ID for each language and installs satellite assemblies in a language-specific subdirectory for each language. When uninstalling, the application removes only the satellite assemblies associated with a given language and .NET Framework version. No core .NET Framework files are removed unless the last language for that .NET Framework version is being removed.&lt;br /&gt;&lt;br /&gt;36. How will u load dynamic assembly? How will create assemblies at run time?&lt;br /&gt;Dynamic assemblies are run directly from memory and are not saved to disk before execution. Dynamic assemblies can save to disk after they have executed.&lt;br /&gt;The .Net Framework provides two main options when it comes to creating dynamic assemblies. The first option is to use the System.CodeDom classes to programmatically create code constructs, save the results to disk, invoke a compiler, and then dynamically load the assembly into memory.  The second more direct approach is to use the System.Reflection.Emit classes to create a dynamic assembly using Intermediate Language.&lt;br /&gt;&lt;br /&gt;37. What is Assembly manifest? What all details the assembly manifest will contain?&lt;br /&gt;An integral part of every assembly that renders the assembly self-describing.  The assembly manifest contains this assembly metadata. An assembly manifest contains all the metadata needed to specify the assembly&#39;s version requirements and security identity, and all metadata needed to define the scope of the assembly and resolve references to resources and classes. The assembly manifest can be stored in either a PE file (an .exe or .dll) with Microsoft intermediate language (MSIL) code or in a standalone PE file that contains only assembly manifest information. It contains Assembly name, Version number, Culture, Strong name information, List of all files in the assembly, Type reference information, Information on referenced assemblies. &lt;br /&gt;&lt;br /&gt;38. Difference between assembly manifest &amp; metadata?&lt;br /&gt;Assembly manifest - An integral part of every assembly that renders the assembly self-describing. The assembly manifest contains the assembly&#39;s metadata. The manifest establishes the assembly identity, specifies the files that make up the assembly implementation, specifies the types and resources that make up the assembly, itemizes the compile-time dependencies on other assemblies, and specifies the set of permissions required for the assembly to run properly. This information is used at run time to resolve references, enforce version binding policy, and validate the integrity of loaded assemblies. The self-describing nature of assemblies also helps makes zero-impact install and XCOPY deployment feasible.&lt;br /&gt;Metadata - Information that describes every element managed by the common language runtime: an assembly, loadable file, type, method, and so on. This can include information required for debugging and garbage collection, as well as security attributes, marshaling data, extended class and member definitions, version binding, and other information required by the runtime.&lt;br /&gt;&lt;br /&gt;39. What is Global Assembly Cache (GAC) and what is the purpose of it? &lt;br /&gt;A machine-wide code cache that stores assemblies specifically installed to be shared by many applications on the computer. Applications deployed in the global assembly cache must have a strong name.&lt;br /&gt;&lt;br /&gt;40. How to make an assembly to public? Steps&lt;br /&gt;Steps&lt;br /&gt;- Create a strong name using sn.exe tool. eg: sn -k keyPair.snk&lt;br /&gt;- with in AssemblyInfo.vb add the generated file name eg: [assembly: AssemblyKeyFile(&quot;abc.snk&quot;)]&lt;br /&gt;- recompile project, then install it to GAC by either drag &amp; drop it to assembly folder (C:\WINDOWS\assembly OR C:\WINNT\assembly) (shfusion.dll tool) or gacutil -i abc.dll &lt;br /&gt;&lt;br /&gt;41. How more than one version of an assembly can keep in same place? &lt;br /&gt;Because of the strong naming concept. Strong names guarantee name uniqueness by relying on unique key pairs. No one can generate the same assembly name that you can, because an assembly generated with one private key has a different name than an assembly generated with another private key names.&lt;br /&gt;&lt;br /&gt;42. If I have more than one version of one assemblies, then how&#39;ll I use old version (how/where to specify version number? in my application?&lt;br /&gt;By using an application configuration file.  The application configuration file can redirect an application to use a different version of an assembly or look in a different location for an assembly&lt;br /&gt;&lt;br /&gt;43. How to find methods of an assembly file (not using ILDASM)&lt;br /&gt;With Reflection. &lt;br /&gt;&lt;br /&gt;44. What is Garbage Collection in .Net? Garbage collection process?&lt;br /&gt;Garbage collection is a system whereby a run-time component takes responsibility for managing the lifetime of objects and the heap memory that they occupy.&lt;br /&gt;The process of transitively tracing through all pointers to actively used objects in order to locate all objects that can be referenced, and then arranging to reuse any heap memory that was not found during this trace. The common language runtime garbage collector also compacts the memory that is in use to reduce the working space needed for the heap. &lt;br /&gt;&lt;br /&gt;45. What is Reflection in .NET? Namespace?  How will you load an assembly, which is not referenced by current assembly? &lt;br /&gt;Reflection is a process of retrieving metadata information about the types, attributes during runtime.&lt;br /&gt;&lt;br /&gt;All .NET compilers produce metadata about the types defined in the modules they produce. This metadata is packaged along with the module (modules in turn are packaged together in assemblies), and can be accessed by a mechanism called reflection. The System.Reflection namespace contains classes that can be used to interrogate the types for a module/assembly. Using reflection to access .NET metadata is very similar to using ITypeLib/ITypeInfo to access type library data in COM, and it is used for similar purposes - e.g. determining data type sizes for marshaling data across context/process/machine boundaries. Reflection can also be used to dynamically invoke methods (see System.Type.InvokeMember), or even create types dynamically at run-time (see System.Reflection.Emit.TypeBuilder).&lt;br /&gt;&lt;br /&gt;46. What is Custom attribute? How to create? If I&#39;m having custom attribute in an assembly, how to say that name in the code? &lt;br /&gt;An attribute defined by a programmer to store the instance of any data type in metadata.&lt;br /&gt;The primary steps to properly design custom attribute classes are as follows: &lt;br /&gt;Applying the AttributeUsageAttribute ([AttributeUsage(AttributeTargets.All, Inherited = false, AllowMultiple = true)]) &lt;br /&gt;Declaring the attribute. (class public class MyAttribute : System.Attribute { // . . . }) &lt;br /&gt;Declaring constructors (public MyAttribute(bool myvalue) { this.myvalue = myvalue; }) &lt;br /&gt;Declaring properties &lt;br /&gt;public bool MyProperty&lt;br /&gt;{&lt;br /&gt;get {return this.myvalue;}&lt;br /&gt;set {this.myvalue = value;}&lt;br /&gt;} &lt;br /&gt;The following example demonstrates the basic way of using reflection to get access to custom attributes. &lt;br /&gt;class MainClass &lt;br /&gt;{&lt;br /&gt;public static void Main()&lt;br /&gt;{&lt;br /&gt;System.Reflection.MemberInfo info = typeof(MyClass);&lt;br /&gt;object[] attributes = info.GetCustomAttributes();&lt;br /&gt;for (int i = 0; i &lt; attributes.Length; i ++) &lt;br /&gt;{&lt;br /&gt;System.Console.WriteLine(attributes[i]);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;47. What is the managed and unmanaged code in .net?&lt;br /&gt;Managed Code: Code executed and managed by the NET Framework&#39;s common language runtime. Managed code must supply the information necessary for the common language runtime to provide services such as memory management, cross-language integration, code access security, and automatic lifetime control of objects. All code based on Microsoft Intermediate Language executes as managed code.&lt;br /&gt;Un-Managed Code: Code that is created without regard for the conventions and requirements of the common language runtime. Unmanaged code executes in the common language runtime environment with minimal services (for example, no garbage collection, limited debugging, and so on).&lt;br /&gt;&lt;br /&gt;48. What is threading?  How do you create threading in .NET and what is the namespace for that?&lt;br /&gt;Threading is the ability of a single application (process) to perform multiple units of work that are controlled by the parent application.&lt;br /&gt;New System.Threading.Thread&lt;br /&gt;    (AddressOf(method)).&lt;br /&gt;Some Methods:&lt;br /&gt;Start(). Start processing on the Thread.&lt;br /&gt;Sleep(). Wait X milliseconds.&lt;br /&gt;Join(). Wait on a thread to finish.&lt;br /&gt;Resume(). Start processing again.&lt;br /&gt;Abort(). Quit the thread.&lt;br /&gt;&lt;br /&gt;Threading is created by using System.Threading.Thread namespace.&lt;br /&gt;&lt;br /&gt;49. Using directive vs using statement&lt;br /&gt;You create an instance in a using statement to ensure that Dispose is called on the object when the using statement is exited. A using statement can be exited either when the end of the using statement is reached or if, for example, an exception is thrown and control leaves the statement block before the end of the statement.&lt;br /&gt;The using directive has two uses: &lt;br /&gt;Create an alias for a namespace (a using alias). &lt;br /&gt;Permit the use of types in a namespace, such that, you do not have to qualify the use of a type in that namespace (a using directive). &lt;br /&gt;&lt;br /&gt;50. Describe the Managed Execution Process?&lt;br /&gt;The managed execution process includes the following steps: Choosing a compiler - To obtain the benefits provided by the common language runtime, you must use one or more language compilers that target the runtime.&lt;br /&gt;Compiling your code to Microsoft intermediate language (MSIL) - Compiling translates your source code into MSIL and generates the required metadata.&lt;br /&gt;Compiling MSIL to native code - At execution time, a just-in-time (JIT) compiler translates the MSIL into native code. During this compilation, code must pass a verification process that examines the MSIL and metadata to find out whether the code can be determined to be type safe.&lt;br /&gt;Executing your code - The common language runtime provides the infrastructure that enables execution to take place as well as a variety of services that can be used during execution.&lt;br /&gt;&lt;br /&gt;51. What is Active Directory? What is the namespace used to access the Microsoft Active Directories? What are ADSI Directories?&lt;br /&gt;Active Directory Service Interfaces (ADSI) is a programmatic interface for Microsoft Windows Active Directory. It enables your applications to interact with diverse directories on a network, using a single interface. Visual Studio .NET and the .NET Framework make it easy to add ADSI functionality with the DirectoryEntry and DirectorySearcher components. Using ADSI, you can create applications that perform common administrative tasks, such as backing up databases, accessing printers, and administering user accounts. ADSI makes it possible for you to –&lt;br /&gt;Log on once to work with diverse directories. 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.&lt;br /&gt;Use a single application-programming interface (API) to perform tasks on multiple directory systems by offering the user a variety of protocols to use. The DirectoryServices namespace provides the classes to perform most administrative functions.&lt;br /&gt;Perform &quot;rich querying&quot; on directory systems. ADSI technology allows for searching for an object by specifying two query dialects: SQL and LDAP.&lt;br /&gt;Access and use a single, hierarchical structure for administering and maintaining diverse and complicated network configurations by accessing an Active Directory tree.&lt;br /&gt;Integrate directory information with databases such as SQL Server. The DirectoryEntry path may be used as an ADO.NET connection string provided that it is using the LDAP provider using System.DirectoryServices;&lt;br /&gt;&lt;br /&gt;52. How Garbage Collector (GC) Works?&lt;br /&gt;The methods in this class influence when an object is garbage collected and when resources allocated by an object are released. Properties in this class provide information about the total amount of memory available in the system and the age category, or generation, of memory allocated to an object. Periodically, the garbage collector performs garbage collection to reclaim memory allocated to objects for which there are no valid references. Garbage collection happens automatically when a request for memory cannot be satisfied using available free memory. Alternatively, an application can force garbage collection using the Collect method.&lt;br /&gt;Garbage collection consists of the following steps: &lt;br /&gt;The garbage collector searches for managed objects that are referenced in managed code. &lt;br /&gt;The garbage collector attempts to finalize objects that are not referenced. &lt;br /&gt;The garbage collector frees objects that are not referenced and reclaims their memory.&lt;br /&gt;&lt;br /&gt;53. Why do we need to call CG.SupressFinalize?&lt;br /&gt;Requests that the system not call the finalizer method for the specified object. &lt;br /&gt;public static void SuppressFinalize(object obj); The method removes obj from the set of objects that require finalization. The obj parameter is required to be the caller of this method. Objects that implement the IDisposable interface can call this method from the IDisposable.Dispose method to prevent the garbage collector from calling Object.Finalize on an object that does not require it.&lt;br /&gt;&lt;br /&gt;54. What is nmake tool?&lt;br /&gt;The Nmake tool (Nmake.exe) is a 32-bit tool that you use to build projects based on commands contained in a .mak file.  usage : nmake -a all&lt;br /&gt;&lt;br /&gt;55. What are Namespaces?&lt;br /&gt;The namespace keyword is used to declare a scope. This namespace scope lets you organize code and gives you a way to create globally-unique types. Even if you do not explicitly declare one, a default namespace is created. This unnamed namespace, sometimes called the global namespace, is present in every file. Any identifier in the global namespace is available for use in a named namespace. Namespaces implicitly have public access and this is not modifiable.&lt;br /&gt;&lt;br /&gt;56. What is the difference between CONST and READONLY?&lt;br /&gt;Both are meant for constant values. A const field can only be initialized at the declaration of the field. A readonly field can be initialized either at the declaration or in a constructor. Therefore, readonly fields can have different values depending on the constructor used. &lt;br /&gt;Also, while a const field is a compile-time constant, the readonly field can be used for runtime constants, as in the following example:&lt;br /&gt;&lt;br /&gt;57.What is the difference between ref &amp; out parameters?&lt;br /&gt;An argument passed to a ref parameter must first be initialized. Compare this to an out parameter, whose argument does not have to be explicitly initialized before being passed to an out parameter.&lt;br /&gt;&lt;br /&gt;58. What is the difference between Array and LinkedList?&lt;br /&gt;An array could be a contagious area of memory index by a pointer, whereas the LinkedList would consist of a series of nodes that mutually reference one another.&lt;br /&gt;&lt;br /&gt;59. What is the difference between Array and Arraylist?&lt;br /&gt;Array is a fixed-capacity construct that can have one or more dimensions. The .NET Framework supports multi-dimensional arrays similar to Pascal arrays, and jagged arrays such as you find in C.&lt;br /&gt;ArrayList is a one-dimensional, expandable list that provides some advanced capabilities like the ability to add, insert, or remove multiple items in a single operation.&lt;br /&gt;As elements are added to an ArrayList, the capacity is automatically increased as required through reallocation. The capacity can be decreased by calling TrimToSize or by setting the Capacity property explicitly. &lt;br /&gt;&lt;br /&gt;60. What is Jagged Arrays?&lt;br /&gt;A jagged array is an array whose elements are arrays. The elements of a jagged array can be of different dimensions and sizes. A jagged array is sometimes called an &quot;array-of-arrays.&quot; &lt;br /&gt;&lt;br /&gt;61. What are indexers?&lt;br /&gt;Indexers are similar to properties, except that the get and set accessors of indexers take parameters, while property accessors do not.&lt;br /&gt;&lt;br /&gt;62. What is Asynchronous call and how it can be implemented using delegates?&lt;br /&gt;A function that enables processing to continue without waiting for the function to return a value.&lt;br /&gt;&lt;br /&gt;How to create events for a control? What is custom events? How to create it?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If you want to write your own dot net language, what steps you will u take care?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Describe the difference between inline and code behind - which is best in a loosely coupled solution?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;How dot net compiled code will become platform independent?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Without modifying source code if we compile again, will it be generated MSIL again?&lt;br /&gt;C++ &amp; C# differences&lt;br /&gt; &lt;br /&gt;(COM) &lt;br /&gt;1. Interop Services?&lt;br /&gt;The common language runtime provides two mechanisms for interoperating with unmanaged code:&lt;br /&gt;Platform invoke, which enables managed code to call functions exported from an unmanaged library.&lt;br /&gt;COM interop, which enables managed code to interact with COM objects through interfaces.&lt;br /&gt;Both platform invoke and COM interop use interop marshaling to accurately move method arguments between caller and callee and back, if required.&lt;br /&gt;&lt;br /&gt;2. How does u handle this COM components developed in other programming languages in .NET?&lt;br /&gt;NET Framework exposes COM objects through a proxy called Runtime-Callable Wrapper (RCW). Primary function of RCW is to marshal call between a managed client (.NET) and unmanaged COM object. Runtime maintains single RCW for each COM object.&lt;br /&gt;Register the COM component by calling regsvr32 from command line&lt;br /&gt;There are four ways to create an interop assembly &lt;br /&gt;Add reference to the type library using Visual Studio.NET&lt;br /&gt;Open .NET project in Visual Studio.NET and add reference to the COM component using the Add Reference dialog box. This will automatically create interop assembly containing metadata.&lt;br /&gt;Type Library Importer&lt;br /&gt;Use Type Library Importer (TlbImp.exe). TlbImp.exe is a command-line tool that converts COM type library to assembly containing metadata.&lt;br /&gt;TypeLibConverter Class&lt;br /&gt;TypeLibConverter Class of the System.Runtime.InteropServices namespace provides methods to convert type library to assembly. This API can convert in-memory Type library and produces the same output as TlbImp.exe&lt;br /&gt;Custom Wrappers&lt;br /&gt;You can create a duplicate definition of the class or interface in managed source code. You then compile the source code with compiler that targets the runtime to produce metadata in assembly. To define COM types manually, you must know exact descriptions of the coclasses and interfaces being defined and know the type library-to-assembly conversion rules. Writing custom wrapper is advanced technique that you seldom perform. &lt;br /&gt;&lt;br /&gt;3. What is RCW (Runtime Callable Wrappers)?&lt;br /&gt;The common language runtime exposes COM objects through a proxy called the runtime callable wrapper (RCW). Although the RCW appears to be an ordinary object to .NET clients, its primary function is to marshal calls between a .NET client and a COM object.&lt;br /&gt;&lt;br /&gt;4. What is CCW (COM Callable Wrapper)? &lt;br /&gt;A proxy object generated by the common language runtime so that existing COM applications can use managed classes, including .NET Framework classes, transparently.&lt;br /&gt;&lt;br /&gt;5. How will you register com+ services?&lt;br /&gt;The .NET Framework SDK provides the .NET Framework Services Installation Tool (Regsvcs.exe - a command-line tool) to manually register an assembly containing serviced components. You can also access these registration features programmatically with the System.EnterpriseServicesRegistrationHelper class by creating an instance of class RegistrationHelper and using the method InstallAssembly &lt;br /&gt;&lt;br /&gt;6. What is use of ContextUtil class?&lt;br /&gt;ContextUtil is the preferred class to use for obtaining COM+ context information. &lt;br /&gt;&lt;br /&gt;7. What are the new three features of COM+ services, which are not there in COM (MTS)?&lt;br /&gt;	Queued Components QC, Lousily Coupled Even, Object pooling and Dynamic Load Balancing&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;8. Is the COM architecture same as .Net architecture?  What is the difference between them?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;9. Can we copy a COM dll to GAC folder?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;10. What is Pinvoke?&lt;br /&gt;Platform invoke is a service that enables managed code to call unmanaged functions implemented in dynamic-link libraries (DLLs), such as those in the Win32 API. It locates and invokes an exported function and marshals its arguments (integers, strings, arrays, structures, and so on) across the interoperation boundary as needed.&lt;br /&gt;&lt;br /&gt;11. Is it true that COM objects no longer need to be registered on the server?&lt;br /&gt;Yes and No. Legacy COM objects still need to be registered on the server before they can be used. COM developed using the new .NET Framework will not need to be registered. Developers will be able to auto-register these objects just by placing them in the &#39;bin&#39; folder of the application. &lt;br /&gt;&lt;br /&gt;12. Can .NET Framework components use the features of Component Services?&lt;br /&gt;Yes, you can use the features and functions of Component Services from a .NET Framework component. &lt;br /&gt; &lt;br /&gt;&lt;br /&gt;OOPS &lt;br /&gt;1. What are the OOPS concepts?&lt;br /&gt;1) Abstraction: Abstraction is the separation of the implementation of an object from its interface. An instance of one class (an object) can use functions in another class without needing to know how it has been implemented. The implementation of a function in a class, or the way we store data could change, as long as the interface remains the same, and other code would not be affected.&lt;br /&gt;1) Encapsulation: It is the mechanism that binds together code and data in manipulates, and keeps both safe from outside interference and misuse. In short it isolates a particular code and data from all other codes and data. A well-defined interface controls the access to that particular code and data.&lt;br /&gt;2) Inheritance: It is the process by which one object acquires the properties of another object. This supports the hierarchical classification. Without the use of hierarchies, each object would need to define all its characteristics explicitly. However, by use of inheritance, an object need only define those qualities that make it unique within its class. It can inherit its general attributes from its parent. A new sub-class inherits all of the attributes of all of its ancestors.&lt;br /&gt;3) Polymorphism: It is a feature that allows one interface to be used for general class of actions. The specific action is determined by the exact nature of the situation. In general polymorphism means &quot;one interface, multiple methods&quot;, This means that it is possible to design a generic interface to a group of related activities. This helps reduce complexity by allowing the same interface to be used to specify a general class of action. It is the compiler&#39;s job to select the specific action (that is, method) as it applies to each situation. &lt;br /&gt;&lt;br /&gt;2. What is the difference between a Struct and a Class? &lt;br /&gt;The struct type is suitable for representing lightweight objects such as Point, Rectangle, and Color. Although it is possible to represent a point as a class, a struct is more efficient in some scenarios. For example, if you declare an array of 1000 Point objects, you will allocate additional memory for referencing each object. In this case, the struct is less expensive. &lt;br /&gt;When you create a struct object using the new operator, it gets created and the appropriate constructor is called. Unlike classes, structs can be instantiated without using the new operator. If you do not use new, the fields will remain unassigned and the object cannot be used until all of the fields are initialized. &lt;br /&gt;It is an error to declare a default (parameterless) constructor for a struct. A default constructor is always provided to initialize the struct members to their default values. &lt;br /&gt;It is an error to initialize an instance field in a struct. &lt;br /&gt;There is no inheritance for structs as there is for classes. A struct cannot inherit from another struct or class, and it cannot be the base of a class. Structs, however, inherit from the base class Object. A struct can implement interfaces, and it does that exactly as classes do. &lt;br /&gt;A struct is a value type, while a class is a reference type. &lt;br /&gt;&lt;br /&gt;3. Value type &amp; reference types difference? Example from .NET. Integer &amp; struct are value types or reference types in .NET?&lt;br /&gt;Most programming languages provide built-in data types, such as integers and floating-point numbers, that are copied when they are passed as arguments (that is, they are passed by value). In the .NET Framework, these are called value types. The runtime supports two kinds of value types: &lt;br /&gt;Built-in value types &lt;br /&gt;The .NET Framework defines built-in value types, such as System.Int32 and System.Boolean, which correspond and are identical to primitive data types used by programming languages. &lt;br /&gt;User-defined value types &lt;br /&gt;Your language will provide ways to define your own value types, which derive from System.ValueType. If you want to define a type representing a value that is small, such as a complex number (using two floating-point numbers), you might choose to define it as a value type because you can pass the value type efficiently by value. If the type you are defining would be more efficiently passed by reference, you should define it as a class instead. &lt;br /&gt;Variables of reference types, referred to as objects, store references to the actual data. This following are the reference types: class, interface, delegate.&lt;br /&gt;This following are the built-in reference types: object and string&lt;br /&gt;&lt;br /&gt;4. What is Inheritance, Multiple Inheritance, Shared and Repeatable Inheritance?&lt;br /&gt;&lt;br /&gt;5. What is Method overloading?&lt;br /&gt;Method overloading occurs when a class contains two methods with the same name, but different signatures.&lt;br /&gt;&lt;br /&gt;6. What is Method Overriding? How to override a function in C#?&lt;br /&gt;Use the override modifier to modify a method, a property, an indexer, or an event. An override method provides a new implementation of a member inherited from a base class. The method overridden by an override declaration is known as the overridden base method. The overridden base method must have the same signature as the override method.&lt;br /&gt;You cannot override a non-virtual or static method. The overridden base method must be virtual, abstract, or override. &lt;br /&gt;&lt;br /&gt;7. Can we call a base class method without creating instance?&lt;br /&gt;Its possible If its a static method.&lt;br /&gt;Its possible by inheriting from that class also.&lt;br /&gt;Its possible from derived classes using base keyword. &lt;br /&gt;&lt;br /&gt;8. You have one base class virtual function how will call that function from derived class?&lt;br /&gt;Ans:&lt;br /&gt;1.	class a&lt;br /&gt;2.	              {&lt;br /&gt;3.	              	public virtual int m()&lt;br /&gt;4.	              	{&lt;br /&gt;5.	              		return 1;&lt;br /&gt;6.	              	}&lt;br /&gt;7.	              }&lt;br /&gt;8.	              class b:a&lt;br /&gt;9.	              {&lt;br /&gt;10.	              	public int j()&lt;br /&gt;11.	              	{&lt;br /&gt;12.	              		return m();&lt;br /&gt;13.	              	}&lt;br /&gt;              }&lt;br /&gt;9. In which cases you use override and new base?&lt;br /&gt;Use the new modifier to explicitly hide a member inherited from a base class. To hide an inherited member, declare it in the derived class using the same name, and modify it with the new modifier. &lt;br /&gt;&lt;br /&gt;C# Language features &lt;br /&gt;1.  What are Sealed Classes in C#?&lt;br /&gt;The sealed modifier is used to prevent derivation from a class. A compile-time error occurs if a sealed class is specified as the base class of another class. (A sealed class cannot also be an abstract class) &lt;br /&gt;&lt;br /&gt;2. In which Scenario you will go for Interface or Abstract Class?&lt;br /&gt;Interfaces, like classes, define a set of properties, methods, and events. But unlike classes, interfaces do not provide implementation. They are implemented by classes, and defined as separate entities from classes. Even though class inheritance allows your classes to inherit implementation from a base class, it also forces you to make most of your design decisions when the class is first published.&lt;br /&gt;Abstract classes are useful when creating components because they allow you specify an invariant level of functionality in some methods, but leave the implementation of other methods until a specific implementation of that class is needed. They also version well, because if additional functionality is needed in derived classes, it can be added to the base class without breaking code. &lt;br /&gt;Interfaces vs. Abstract Classes&lt;br /&gt;Feature	Interface	Abstract class&lt;br /&gt;Multiple inheritance	A class may implement several interfaces. 	A class may extend only one abstract class. &lt;br /&gt;Default implementation	An interface cannot provide any code at all, much less default code.	An abstract class can provide complete code, default code, and/or just stubs that have to be overridden.&lt;br /&gt;Constants	Static final constants only, can use them without qualification in classes that implement the interface. On the other paw, these unqualified names pollute the namespace. You can use them and it is not obvious where they are coming from since the qualification is optional. 	Both instance and static constants are possible. Both static and instance intialiser code are also possible to compute the constants.&lt;br /&gt;Third party convenience 	An interface implementation may be added to any existing third party class. 	A third party class must be rewritten to extend only from the abstract class.&lt;br /&gt;is-a vs -able or can-do 	Interfaces are often used to describe the peripheral abilities of a class, not its central identity, e.g. an Automobile class might implement the Recyclable interface, which could apply to many otherwise totally unrelated objects. 	An abstract class defines the core identity of its descendants. If you defined a Dog abstract class then Damamation descendants are Dogs, they are not merely dogable. Implemented interfaces enumerate the general things a class can do, not the things a class is. &lt;br /&gt;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. When you implement the interface, you start from scratch without any default implementation. You have to obtain your tools from other classes; nothing comes with the interface other than a few constants. This gives you freedom to implement a radically different internal design. 	You must use the abstract class as-is for the code base, with all its attendant baggage, good or bad. The abstract class author has imposed structure on you. Depending on the cleverness of the author of the abstract class, this may be good or bad. Another issue that&#39;s important is what I call &quot;heterogeneous vs. homogeneous.&quot; If implementors/subclasses are homogeneous, tend towards an abstract base class. If they are heterogeneous, use an interface. (Now all I have to do is come up with a good definition of hetero/homogeneous in this context.) If the various objects are all of-a-kind, and share a common state and behavior, then tend towards a common base class. If all they share is a set of method signatures, then tend towards an interface.&lt;br /&gt;Homogeneity 	If all the various implementations share is the method signatures, then an interface works best. 	If the various implementations are all of a kind and share a common status and behavior, usually an abstract class works best.&lt;br /&gt;Maintenance 	If your client code talks only in terms of an interface, you can easily change the concrete implementation behind it, using a factory method. 	Just like an interface, if your client code talks only in terms of an abstract class, you can easily change the concrete implementation behind it, using a factory method.&lt;br /&gt;Speed 	Slow, requires extra indirection to find the corresponding method in the actual class. Modern JVMs are discovering ways to reduce this speed penalty. 	Fast&lt;br /&gt;Terseness 	The constant declarations in an interface are all presumed public static final, so you may leave that part out. You can&#39;t call any methods to compute the initial values of your constants. You need not declare individual methods of an interface abstract. They are all presumed so.	You can put shared code into an abstract class, where you cannot into an interface. If interfaces want to share code, you will have to write other bubblegum to arrange that. You may use methods to compute the initial values of your constants and variables, both instance and static. You must declare all the individual methods of an abstract class abstract.&lt;br /&gt;Adding functionality 	If you add a new method to an interface, you must track down all implementations of that interface in the universe and provide them with a concrete implementation of that method.	If you add a new method to an abstract class, you have the option of providing a default implementation of it. Then all existing code will continue to work without change.&lt;br /&gt;&lt;br /&gt;3. Write one code example for compile time binding and one for run time binding? What is early/late binding?&lt;br /&gt;An object is early bound when it is assigned to a variable declared to be of a specific object type. Early bound objects allow the compiler to allocate memory and perform other optimizations before an application executes.&lt;br /&gt;&#39; Create a variable to hold a new object.&lt;br /&gt;Dim FS As FileStream&lt;br /&gt;&#39; Assign a new object to the variable.&lt;br /&gt;FS = New FileStream(&quot;C:\tmp.txt&quot;, FileMode.Open)&lt;br /&gt;By contrast, an object is late bound when it is assigned to a variable declared to be of type Object. Objects of this type can hold references to any object, but lack many of the advantages of early-bound objects.&lt;br /&gt;Dim xlApp As Object&lt;br /&gt;xlApp = CreateObject(&quot;Excel.Application&quot;) &lt;br /&gt;4. Can you explain what inheritance is and an example of when you might use it? &lt;br /&gt;&lt;br /&gt;5. How can you write a class to restrict that only one object of this class can be created (Singleton class)? &lt;br /&gt;(Access specifiers)&lt;br /&gt;&lt;br /&gt;6. What are the access-specifiers available in c#?&lt;br /&gt;Private, Protected, Public, Internal, Protected Internal.&lt;br /&gt;&lt;br /&gt;7. Explain about Protected and protected internal, “internal” access-specifier?&lt;br /&gt;protected - Access is limited to the containing class or types derived from the containing class. &lt;br /&gt;internal - Access is limited to the current assembly.&lt;br /&gt;protected internal - Access is limited to the current assembly or types derived from the containing class.&lt;br /&gt;&lt;br /&gt;(Constructor / Destructor) &lt;br /&gt;8. Difference between type constructor and instance constructor? What is static constructor, when it will be fired? And what is its use?&lt;br /&gt;(Class constructor method is also known as type constructor or type initializer)&lt;br /&gt;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. (It will get executed only 1st time, when we call any static methods/fields in the same class.) Class constructors are used for static field initialization. Only one class constructor per type is permitted, and it cannot use the vararg (variable argument) calling convention.&lt;br /&gt;A static constructor is used to initialize a class. It is called automatically to initialize the class before the first instance is created or any static members are referenced.&lt;br /&gt;&lt;br /&gt;9. What is Private Constructor? and it’s use? Can you create instance of a class which has Private Constructor?&lt;br /&gt;When a class declares only private instance constructors, it is not possible for classes outside the program to derive from the class or to directly create instances of it. (Except Nested classes)&lt;br /&gt;Make a constructor private if:&lt;br /&gt;- You want it to be available only to the class itself. For example, you might have a special constructor used only in the implementation of your class&#39; Clone method.&lt;br /&gt;- You do not want instances of your component to be created. For example, you may have a class containing nothing but Shared utility functions, and no instance data. Creating instances of the class would waste memory.&lt;br /&gt;&lt;br /&gt;10. I have 3 overloaded constructors in my class. In order to avoid making instance of the class do I need to make all constructors to private?&lt;br /&gt;Yes&lt;br /&gt;&lt;br /&gt;11. Overloaded constructor will call default constructor internally?&lt;br /&gt;No &lt;br /&gt;&lt;br /&gt;12. What are virtual destructors? &lt;br /&gt;14.	Destructor and finalize&lt;br /&gt;Generally in C++ the destructor is called when objects gets destroyed. And one can explicitly call the destructors in C++. And also the objects are destroyed in reverse order that they are created in. So in C++ you have control over the destructors.&lt;br /&gt;In C# you can never call them, the reason is one cannot destroy an object. So who has the control over the destructor (in C#)? it&#39;s the .Net frameworks Garbage Collector (GC). GC destroys the objects only when necessary. Some situations of necessity are memory is exhausted or user explicitly calls System.GC.Collect() method.&lt;br /&gt;Points to remember:&lt;br /&gt;1. Destructors are invoked automatically, and cannot be invoked explicitly.&lt;br /&gt;2. Destructors cannot be overloaded. Thus, a class can have, at most, one destructor.&lt;br /&gt;3. Destructors are not inherited. Thus, a class has no destructors other than the one, which may be declared in it.&lt;br /&gt;4. Destructors cannot be used with structs. They are only used with classes.&lt;br /&gt;5. An instance becomes eligible for destruction when it is no longer possible for any code to use the instance. &lt;br /&gt;6. Execution of the destructor for the instance may occur at any time after the instance becomes eligible for destruction.&lt;br /&gt;7. When an instance is destructed, the destructors in its inheritance chain are called, in order, from most derived to least derived.&lt;br /&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconfinalizemethodscdestructors.asp &lt;br /&gt;15.	What is the difference between Finalize and Dispose (Garbage collection)&lt;br /&gt;Class instances often encapsulate control over resources that are not managed by the runtime, such as window handles (HWND), database connections, and so on. Therefore, you should provide both an explicit and an implicit way to free those resources. Provide implicit control by implementing the protected Finalize Method on an object (destructor syntax in C# and the Managed Extensions for C++). The garbage collector calls this method at some point after there are no longer any valid references to the object.&lt;br /&gt;In some cases, 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. If an external resource is scarce or expensive, better performance can be achieved if the programmer explicitly releases resources when they are no longer being used. To provide explicit control, implement the Dispose method provided by the IDisposable Interface. The consumer of the object should call this method when it is done using the object. Dispose can be called even if other references to the object are alive.&lt;br /&gt;Note that even when you provide explicit control by way of Dispose, 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. &lt;br /&gt;16.	What is close method? How its different from Finalize &amp; Dispose?&lt;br /&gt;** &lt;br /&gt;17.	What is boxing &amp; unboxing? &lt;br /&gt;18.	What is check/uncheck? &lt;br /&gt;19.	What is the use of base keyword? Tell me a practical example for base keyword’s usage? &lt;br /&gt;20.	What are the different .net tools which u used in projects? &lt;br /&gt;21.	try&lt;br /&gt;{&lt;br /&gt;...&lt;br /&gt;}&lt;br /&gt;catch&lt;br /&gt;{&lt;br /&gt;...//exception occurred here. What&#39;ll happen?&lt;br /&gt;}&lt;br /&gt;finally&lt;br /&gt;{&lt;br /&gt;..&lt;br /&gt;}&lt;br /&gt;Ans : It will throw exception. &lt;br /&gt;22.	What will do to avoid prior case?&lt;br /&gt;Ans:&lt;br /&gt;23.	try&lt;br /&gt;24.	{&lt;br /&gt;25.	try&lt;br /&gt;26.	{&lt;br /&gt;27.	...&lt;br /&gt;28.	}&lt;br /&gt;29.	catch&lt;br /&gt;30.	{&lt;br /&gt;31.	...&lt;br /&gt;32.	//exception occurred here.&lt;br /&gt;33.	}&lt;br /&gt;34.	finally&lt;br /&gt;35.	{&lt;br /&gt;36.	...&lt;br /&gt;37.	}&lt;br /&gt;38.	}&lt;br /&gt;39.	catch&lt;br /&gt;40.	{&lt;br /&gt;41.	...&lt;br /&gt;42.	}&lt;br /&gt;43.	finally&lt;br /&gt;44.	{&lt;br /&gt;45.	...&lt;br /&gt;}&lt;br /&gt;46.	try&lt;br /&gt;47.	{&lt;br /&gt;48.	...&lt;br /&gt;49.	}&lt;br /&gt;50.	catch&lt;br /&gt;51.	{&lt;br /&gt;52.	...&lt;br /&gt;53.	}&lt;br /&gt;54.	finally&lt;br /&gt;55.	{&lt;br /&gt;56.	..&lt;br /&gt;57.	}&lt;br /&gt;58.	Will it go to finally block if there is no exception happened?&lt;br /&gt;Ans: Yes. The finally block is useful for cleaning up any resources allocated in the try block. Control is always passed to the finally block regardless of how the try block exits. &lt;br /&gt;59.	Is goto statement supported in C#? How about Java?&lt;br /&gt;Gotos are supported in C#to the fullest. In Java goto is a reserved keyword that provides absolutely no functionality. &lt;br /&gt;60.	What’s different about switch statements in C#? &lt;br /&gt;No fall-throughs allowed. Unlike the C++ switch statement, C# does not support an explicit fall through from one case label to another. If you want, you can use goto a switch-case, or goto default.&lt;br /&gt;case 1:&lt;br /&gt;cost += 25;&lt;br /&gt;break;&lt;br /&gt;case 2:&lt;br /&gt;cost += 25;&lt;br /&gt;goto case 1;&lt;br /&gt;&lt;br /&gt;(ADO.NET) &lt;br /&gt;61.	Advantage of ADO.Net? &lt;br /&gt;•	ADO.NET Does Not Depend On Continuously Live Connections &lt;br /&gt;•	Database Interactions Are Performed Using Data Commands &lt;br /&gt;•	Data Can Be Cached in Datasets &lt;br /&gt;•	Datasets Are Independent of Data Sources &lt;br /&gt;•	Data Is Persisted as XML &lt;br /&gt;•	Schemas Define Data Structures &lt;br /&gt;62.	How would u connect to database using .NET?&lt;br /&gt;SqlConnection nwindConn = new SqlConnection(&quot;Data Source=localhost; Integrated Security=SSPI;&quot; +&lt;br /&gt;                                            &quot;Initial Catalog=northwind&quot;);&lt;br /&gt;nwindConn.Open(); &lt;br /&gt;63.	What are relation objects in dataset and how &amp; where to use them?&lt;br /&gt;In a DataSet that contains multiple DataTable objects, you can use DataRelation objects to relate one table to another, to navigate through the tables, and to return child or parent rows from a related table.  Adding a DataRelation to a DataSet adds, by default, a UniqueConstraint to the parent table and a ForeignKeyConstraint to the child table.&lt;br /&gt;The following code example creates a DataRelation using two DataTable objects in a DataSet. Each DataTable contains a column named CustID, which serves as a link between the two DataTable objects. The example adds a single DataRelation to the Relations collection of the DataSet. The first argument in the example specifies the name of the DataRelation being created. The second argument sets the parent DataColumn and the third argument sets the child DataColumn.&lt;br /&gt;custDS.Relations.Add(&quot;CustOrders&quot;,&lt;br /&gt;custDS.Tables[&quot;Customers&quot;].Columns[&quot;CustID&quot;],&lt;br /&gt;custDS.Tables[&quot;Orders&quot;].Columns[&quot;CustID&quot;]);&lt;br /&gt;&lt;br /&gt;OR&lt;br /&gt;&lt;br /&gt;private void CreateRelation()&lt;br /&gt;{&lt;br /&gt;// Get the DataColumn objects from two DataTable objects in a DataSet.&lt;br /&gt;DataColumn parentCol;&lt;br /&gt;DataColumn childCol;&lt;br /&gt;// Code to get the DataSet not shown here.&lt;br /&gt;parentCol = DataSet1.Tables[&quot;Customers&quot;].Columns[&quot;CustID&quot;];&lt;br /&gt;childCol = DataSet1.Tables[&quot;Orders&quot;].Columns[&quot;CustID&quot;];&lt;br /&gt;// Create DataRelation.&lt;br /&gt;DataRelation relCustOrder;&lt;br /&gt;relCustOrder = new DataRelation(&quot;CustomersOrders&quot;, parentCol, childCol);&lt;br /&gt;// Add the relation to the DataSet.&lt;br /&gt;DataSet1.Relations.Add(relCustOrder);&lt;br /&gt;} &lt;br /&gt;64.	Difference between OLEDB Provider and SqlClient ?&lt;br /&gt;Ans: SQLClient .NET classes are highly optimized for the .net / sqlserver combination and achieve optimal results. The SqlClient data provider is fast. It&#39;s faster than the Oracle provider, and faster than accessing database via the OleDb layer. It&#39;s faster because it accesses the native library (which automatically gives you better performance), and it was written with lots of help from the SQL Server team. &lt;br /&gt;65.	What are the different namespaces used in the project to connect the database? What data providers available in .net to connect to database? &lt;br /&gt;•	System.Data.OleDb – classes that make up the .NET Framework Data Provider for OLE DB-compatible data sources. These classes allow you to connect to an OLE DB data source, execute commands against the source, and read the results. &lt;br /&gt;•	System.Data.SqlClient – classes that make up the .NET Framework Data Provider for SQL Server, which allows you to connect to SQL Server 7.0, execute commands, and read results. The System.Data.SqlClient namespace is similar to the System.Data.OleDb namespace, but is optimized for access to SQL Server 7.0 and later. &lt;br /&gt;•	System.Data.Odbc - classes that make up the .NET Framework Data Provider for ODBC. These classes allow you to access ODBC data source in the managed space. &lt;br /&gt;•	System.Data.OracleClient - classes that make up the .NET Framework Data Provider for Oracle. These classes allow you to access an Oracle data source in the managed space. &lt;br /&gt;66.	Difference between DataReader and DataAdapter / DataSet and DataAdapter? &lt;br /&gt;You can use the ADO.NET DataReader to retrieve a read-only, forward-only stream of data from a database. Using the DataReader can increase application performance and reduce system overhead because only one row at a time is ever in memory.&lt;br /&gt;After creating an instance of the Command object, you create a DataReader by calling Command.ExecuteReader to retrieve rows from a data source, as shown in the following example.&lt;br /&gt;SqlDataReader myReader = myCommand.ExecuteReader();&lt;br /&gt;You use the Read method of the DataReader object to obtain a row from the results of the query.&lt;br /&gt;while (myReader.Read())&lt;br /&gt;  Console.WriteLine(&quot;\t{0}\t{1}&quot;, myReader.GetInt32(0), myReader.GetString(1));&lt;br /&gt;myReader.Close();&lt;br /&gt;The DataSet is a memory-resident representation of data that provides a consistent relational programming model regardless of the data source. It can be used with multiple and differing data sources, used with XML data, or used to manage data local to the application. The DataSet represents a complete set of data including related tables, constraints, and relationships among the tables. The methods and objects in a DataSet are consistent with those in the relational database model. The DataSet can also persist and reload its contents as XML and its schema as XML Schema definition language (XSD) schema.&lt;br /&gt;The DataAdapter serves as a bridge between a DataSet and a data source for retrieving and saving data. The DataAdapter provides this bridge by mapping Fill, which changes the data in the DataSet to match the data in the data source, and Update, which changes the data in the data source to match the data in the DataSet. If you are connecting to a Microsoft SQL Server database, you can increase overall performance by using the SqlDataAdapter along with its associated SqlCommand and SqlConnection. For other OLE DB-supported databases, use the DataAdapter with its associated OleDbCommand and OleDbConnection objects. &lt;br /&gt;67.	Which method do you invoke on the DataAdapter control to load your generated dataset with data?&lt;br /&gt;Fill() &lt;br /&gt;68.	Explain different methods and Properties of DataReader which you have used in your project?&lt;br /&gt;Read&lt;br /&gt;GetString&lt;br /&gt;GetInt32&lt;br /&gt;while (myReader.Read())&lt;br /&gt;  Console.WriteLine(&quot;\t{0}\t{1}&quot;, myReader.GetInt32(0), myReader.GetString(1));&lt;br /&gt;myReader.Close(); &lt;br /&gt;69.	What happens when we issue Dataset.ReadXml command?&lt;br /&gt;Reads XML schema and data into the DataSet. &lt;br /&gt;70.	In how many ways we can retrieve table records count? How to find the count of records in a dataset?&lt;br /&gt;foreach(DataTable thisTable in myDataSet.Tables){&lt;br /&gt;// For each row, print the values of each column.&lt;br /&gt;foreach(DataRow myRow in thisTable.Rows){ &lt;br /&gt;71.	How to check if a datareader is closed or opened?&lt;br /&gt;IsClosed() &lt;br /&gt;72.	What happens when u try to update data in a dataset in .NET while the record is already deleted in SQL SERVER as backend?&lt;br /&gt;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. What will happen? How will you avoid the problem?)&lt;br /&gt;** &lt;br /&gt;73.	How do you merge 2 datasets into the third dataset in a simple manner? OR If you are executing these statements in commandObject. &quot;Select * from Table1;Select * from Table2” how you will deal result set?&lt;br /&gt;For the merge to take place between the datasets, apart from the data type and column name, the table name should also be the same.&lt;br /&gt;ds1.Merge(ds2)&lt;br /&gt;&lt;br /&gt;74.	How do you sort a dataset?&lt;br /&gt;use the DefaultView property of the underlying DataTable, and apply sort/filter conditions as required.&lt;br /&gt;&lt;br /&gt;75.	If a dataset contains 100 rows, how to fetch rows between 5 and 15 only?&lt;br /&gt;** &lt;br /&gt;&lt;br /&gt;76.	Differences between dataset.clone and dataset.copy?&lt;br /&gt;Clone - Copies the structure of the DataSet, including all DataTable schemas, relations, and constraints. Does not copy any data. &lt;br /&gt;Copy - Copies both the structure and data for this DataSet. &lt;br /&gt;77.	What is the use of parameter object?&lt;br /&gt;** &lt;br /&gt;78.	How to generate XML from a dataset and vice versa?&lt;br /&gt;** &lt;br /&gt;79.	What is method to get XML and schema from Dataset?&lt;br /&gt;ans: getXML () and get Schema () &lt;br /&gt;80.	How do u implement locking concept for dataset?&lt;br /&gt;You can implement pessimistic concurrency with a combination of&lt;br /&gt;transactions and explicit read locking. Using the DataSet and the&lt;br /&gt;DataAdapter...&lt;br /&gt;1.Open the DataAdapter&#39;s SelectCommand&#39;s Connection. Start a transaction on&lt;br /&gt;it. With SQL Server, it should be at the serializable isolation level; with&lt;br /&gt;Oracle, either isolation level with do.&lt;br /&gt;2. With Oracle, the SelectCommand should be &quot;SELECT ... FOR UPDATE&quot;. That&lt;br /&gt;forces Oracle to lock the rows.&lt;br /&gt;3. Fill the DataSet with DataAdapter.Fill. Notice that, because the&lt;br /&gt;Connection was opened before calling Fill, the Connection will not&lt;br /&gt;auto-close. Make sure this Connection is associated with the Insert,Update&lt;br /&gt;and DeleteCommand of the DataAdapter and that the same Transaction is&lt;br /&gt;associated with it.&lt;br /&gt;4. Update in the DataSet, then call DataAdapter.Update.&lt;br /&gt;&lt;br /&gt;// With SQL Server&lt;br /&gt;DataSet ds = new DataSet();&lt;br /&gt;SqlConnection conn = new SqlConnection(&lt;br /&gt;&quot;server=localhost;uid=sa;database=pubs&quot;);&lt;br /&gt;conn.Open();&lt;br /&gt;SqlTransaction tx = conn.BeginTransaction(&lt;br /&gt;IsolationLevel.Serializable);&lt;br /&gt;&lt;br /&gt;// lock as little as possible&lt;br /&gt;SqlCommand cmd = new SqlCommand(&lt;br /&gt;&quot;select * from authors where au_id = &#39;172-32-1176&#39;&quot;, conn, tx);&lt;br /&gt;SqlDataAdapter da = new SqlDataAdapter(cmd);&lt;br /&gt;da.Fill(ds, &quot;authors&quot;);&lt;br /&gt;// rows locked here in the database&lt;br /&gt;.&lt;br /&gt;.&lt;br /&gt;.&lt;br /&gt;da.Update(ds, &quot;authors&quot;);&lt;br /&gt;tx.Commit();&lt;br /&gt;// rows unlocked here&lt;br /&gt;da.Dispose();&lt;br /&gt;conn.Close();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;(ASP.NET) &lt;br /&gt;81.	Asp.net and asp – differences? &lt;br /&gt;Code Render Block	Code Declaration Block&lt;br /&gt; 	Compiled&lt;br /&gt;Request/Response	Event Driven&lt;br /&gt; 	Object Oriented - Constructors/Destructors, Inheritance, overloading..&lt;br /&gt; 	Exception Handling - Try, Catch, Finally&lt;br /&gt; 	Down-level Support&lt;br /&gt; 	Cultures&lt;br /&gt; 	User Controls&lt;br /&gt; 	In-built client side validation&lt;br /&gt;Session - weren&#39;t transferable across servers	It can span across servers, It can survive server crashes, can work with browsers that don&#39;t support cookies&lt;br /&gt;built on top of the window &amp; IIS, it was always a separate entity &amp; its functionality was limited.	its an integral part of OS under the .net framework. It shares many of the same objects that traditional applications would use, and all .net objects are available for asp.net&#39;s consumption.&lt;br /&gt; 	Garbage Collection&lt;br /&gt; 	Declare variable with datatype&lt;br /&gt; 	In built graphics support&lt;br /&gt; 	Cultures&lt;br /&gt; &lt;br /&gt;	 &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;82.	How ASP and ASP.NET page works? Explain about asp.net page life cycle?&lt;br /&gt;** &lt;br /&gt;83.	Order of events in an asp.net page? Control Execution Lifecycle? &lt;br /&gt;Phase	What a control needs to do	Method or event to override&lt;br /&gt;Initialize	Initialize settings needed during the lifetime of the incoming Web request. 	Init event (OnInit method)&lt;br /&gt;Load view state	At the end of this phase, the ViewState property of a control is automatically populated as   A control can override the default implementation of the LoadViewState method to customize state restoration.	LoadViewState method&lt;br /&gt;Process postback data	Process incoming form data and update properties accordingly.	LoadPostData method (if IPostBackDataHandler is implemented)&lt;br /&gt;Load	Perform actions common to all requests, such as setting up a database query. At this point, server controls in the tree are created and initialized, the state is restored, and form controls reflect client-side data.	Load event &lt;br /&gt;(OnLoad method)&lt;br /&gt;Send postback change notifications	Raise change events in response to state changes between the current and previous postbacks.	RaisePostDataChangedEvent method (if IPostBackDataHandler is implemented)&lt;br /&gt;Handle postback events	Handle the client-side event that caused the postback and raise appropriate events on the server. 	RaisePostBackEvent method(if IPostBackEventHandler is implemented)&lt;br /&gt;Prerender	Perform any updates before the output is rendered. Any changes made to the state of the control in the prerender phase can be saved, while changes made in the rendering phase are lost.	PreRender event &lt;br /&gt;(OnPreRender method)&lt;br /&gt;Save state	The ViewState property of a control is automatically persisted to a string object after this stage. This string object is sent to the client and back as a hidden variable. For improving efficiency, a control can override the SaveViewState method to modify the ViewState property.	SaveViewState method&lt;br /&gt;Render	Generate output to be rendered to the client.	Render method&lt;br /&gt;Dispose	Perform any final cleanup before the control is torn down. References to expensive resources such as database connections must be released in this phase.	Dispose method&lt;br /&gt;Unload	Perform any final cleanup before the control is torn down. Control authors generally perform cleanup in Dispose and do not handle this event. 	UnLoad event (On UnLoad method)&lt;br /&gt;84.	Note   To override an EventName event, override the OnEventName method (and call base. OnEventName).&lt;br /&gt;  &lt;br /&gt;85.	What are server controls?&lt;br /&gt;ASP.NET server controls are components that run on the server and encapsulate user-interface and other related functionality. They are used in ASP.NET pages and in ASP.NET code-behind classes. &lt;br /&gt;86.	What is the difference between Web User Control and Web Custom Control?&lt;br /&gt;Custom Controls&lt;br /&gt;Web custom controls are compiled components that run on the server and that encapsulate user-interface and other related functionality into reusable packages. They can include all the design-time features of standard ASP.NET server controls, including full support for Visual Studio design features such as the Properties window, the visual designer, and the Toolbox. &lt;br /&gt;There are several ways that you can create Web custom controls: &lt;br /&gt;•	You can compile a control that combines the functionality of two or more existing controls. For example, if you need a control that encapsulates a button and a text box, you can create it by compiling the existing controls together. &lt;br /&gt;•	If an existing server control almost meets your requirements but lacks some required features, you can customize the control by deriving from it and overriding its properties, methods, and events. &lt;br /&gt;•	If none of the existing Web server controls (or their combinations) meet your requirements, you can create a custom control by deriving from one of the base control classes. These classes provide all the basic functionality of Web server controls, so you can focus on programming the features you need. &lt;br /&gt;If none of the existing ASP.NET server controls meet the specific requirements of your applications, you can create either a Web user control or a Web custom control that encapsulates the functionality you need. The main difference between the two controls lies in ease of creation vs. ease of use at design time.&lt;br /&gt;Web user controls are easy to make, but they can be less convenient to use in advanced scenarios. You develop Web user controls almost exactly the same way that you develop Web Forms pages. Like Web Forms, user controls can be created in the visual designer, they can be written with code separated from the HTML, and they can handle execution events. However, because Web user controls are compiled dynamically at run time they cannot be added to the Toolbox, and they are represented by a simple placeholder glyph when added to a page. This makes Web user controls harder to use if you are accustomed to full Visual Studio .NET design-time support, including the Properties window and Design view previews. Also, the only way to share the user control between applications is to put a separate copy in each application, which takes more maintenance if you make changes to the control.&lt;br /&gt;Web custom controls are compiled code, which makes them easier to use but more difficult to create; Web custom controls must be authored in code. Once you have created the control, however, 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.NET server controls. In addition, you can install a single copy of the Web custom control in the global assembly cache and share it between applications, which makes maintenance easier.&lt;br /&gt;Web user controls	Web custom controls&lt;br /&gt;Easier to create	Harder to create&lt;br /&gt;Limited support for consumers who use a visual design tool	Full visual design tool support for consumers&lt;br /&gt;A separate copy of the control is required in each application	Only a single copy of the control is required, in the global assembly cache&lt;br /&gt;Cannot be added to the Toolbox in Visual Studio	Can be added to the Toolbox in Visual Studio&lt;br /&gt;Good for static layout	Good for dynamic layout&lt;br /&gt;&lt;br /&gt;(Session/State) &lt;br /&gt;87.	Application and Session Events&lt;br /&gt;The ASP.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&#39;s session starts or stops: &lt;br /&gt;•	Application events are raised for all requests to an application. For example, Application_BeginRequest is raised when any Web Forms page or XML Web service in your application is requested. This event allows you to initialize resources that will be used for each request to the application. A corresponding event, Application_EndRequest, provides you with an opportunity to close or otherwise dispose of resources used for the request. &lt;br /&gt;•	Session events are similar to application events (there is a Session_OnStart and a Session_OnEnd event), but are raised with each unique session within the application. 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. &lt;br /&gt;You can create handlers for these types of events in the Global.asax file. &lt;br /&gt;88.	Difference between ASP Session and ASP.NET Session?&lt;br /&gt;asp.net session supports cookie less session &amp; it can span across multiple servers. &lt;br /&gt;89.	What is cookie less session? How it works?&lt;br /&gt;By default, ASP.NET will store the session state in the same process that processes the request, just as ASP does. If cookies are not available, a session can be tracked by adding a session identifier to the URL. This can be enabled by setting the following: &lt;br /&gt;&lt;sessionState cookieless=&quot;true&quot; /&gt;&lt;br /&gt;http://samples.gotdotnet.com/quickstart/aspplus/doc/stateoverview.aspx &lt;br /&gt;90.	How you will handle session when deploying application in more than a server? Describe session handling in a webfarm, how does it work and what are the limits?&lt;br /&gt;By default, ASP.NET will store the session state in the same process that processes the request, just as ASP does. Additionally, ASP.NET can store session data in an external process, which can even reside on another machine. To enable this feature: &lt;br /&gt;•	Start the ASP.NET state service, either using the Services snap-in or by executing &quot;net start aspnet_state&quot; on the command line. The state service will by default listen on port 42424. To change the port, modify the registry key for the service: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\aspnet_state\Parameters\Port &lt;br /&gt;•	Set the mode attribute of the &lt;sessionState&gt; section to &quot;StateServer&quot;. &lt;br /&gt;•	Configure the stateConnectionString attribute with the values of the machine on which you started aspnet_state. &lt;br /&gt;The following sample assumes that the state service is running on the same machine as the Web server (&quot;localhost&quot;) and uses the default port (42424): &lt;br /&gt;&lt;sessionState mode=&quot;StateServer&quot; stateConnectionString=&quot;tcpip=localhost:42424&quot; /&gt; &lt;br /&gt;Note that if you try the sample above with this setting, you can reset the Web server (enter iisreset on the command line) and the session state value will persist.&lt;br /&gt;** &lt;br /&gt;91.	What method do you use to explicitly kill a users session?&lt;br /&gt;Abandon() &lt;br /&gt;92.	What are the different ways you would consider sending data across pages in ASP (i.e between 1.asp to 2.asp)?&lt;br /&gt;Session&lt;br /&gt;public properties &lt;br /&gt;93.	What is State Management in .Net and how many ways are there to maintain a state in .Net? What is view state?&lt;br /&gt;Web pages are recreated each time the page is posted to the server. In traditional Web programming, this would ordinarily mean that all information associated with the page and the controls on the page would be lost with each round trip. &lt;br /&gt;To overcome this inherent limitation of traditional Web programming, the ASP.NET page framework includes various options to help you preserve changes — that is, for managing state. 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.&lt;br /&gt;However, you will probably also have application-specific values that you want to preserve. To do so, you can use one of the state management options.&lt;br /&gt;Client-Based State Management Options:&lt;br /&gt;View State&lt;br /&gt;Hidden Form Fields&lt;br /&gt;Cookies&lt;br /&gt;Query Strings&lt;br /&gt;Server-Based State Management Options&lt;br /&gt;Application State&lt;br /&gt;Session State&lt;br /&gt;Database Support &lt;br /&gt;94.	What are the disadvantages of view state / what are the benefits?&lt;br /&gt;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). This feature does impact performance, however, since a server control&#39;s view state is passed to and from the server in a hidden form field. You should be aware of when view state helps you and when it hinders your page&#39;s performance. &lt;br /&gt;95.	When maintaining session through Sql server, what is the impact of Read and Write operation on Session objects? will performance degrade?&lt;br /&gt;Maintaining state using database technology is a common practice when storing user-specific information where the information store is large. Database storage is particularly useful for maintaining long-term state or state that must be preserved even if the server must be restarted.&lt;br /&gt;** &lt;br /&gt;96.	What are the contents of cookie?&lt;br /&gt;User-specific information like &lt;br /&gt;** &lt;br /&gt;97.	How do you create a permanent cookie?&lt;br /&gt;** &lt;br /&gt;98.	What is ViewState? What does the &quot;EnableViewState&quot; property do? Why would I want it on or off?&lt;br /&gt;** &lt;br /&gt;99.	Explain the differences between Server-side and Client-side code?&lt;br /&gt;Server side code will process at server side &amp; it will send the result to client. Client side code (javascript) will execute only at client side. &lt;br /&gt;100.	Can you give an example of what might be best suited to place in the Application_Start and Session_Start subroutines?&lt;br /&gt;** &lt;br /&gt;101.	Which ASP.NET configuration options are supported in the ASP.NET implementation on the shared web hosting platform?&lt;br /&gt;A:  Many of the ASP.NET configuration options are not configurable at the site, application or subdirectory level on the shared hosting platform.  Certain options can affect the security, performance and stability of the server and, therefore cannot be changed.  The following settings are the only ones that can be changed in your site’s web.config file (s):&lt;br /&gt;browserCaps&lt;br /&gt;clientTarget&lt;br /&gt;pages&lt;br /&gt;customErrors&lt;br /&gt;globalization&lt;br /&gt;authorization&lt;br /&gt;authentication&lt;br /&gt;webControls&lt;br /&gt;webServices&lt;br /&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconaspnetconfiguration.asp &lt;br /&gt;102.	Briefly describe the role of global.asax? &lt;br /&gt;includes code for responding to application-level events raised by ASP.NET and by HTTP modules.&lt;br /&gt;103.	How can u debug your .net application? &lt;br /&gt;104.	How do u deploy your asp.net application? &lt;br /&gt;105.	Where do we store our connection string in asp.net application? &lt;br /&gt;106.	Various steps taken to optimize a web based application (caching, stored procedure etc.) &lt;br /&gt;107.	How does ASP.NET framework maps client side events to Server side events.&lt;br /&gt;&lt;br /&gt;(Security) &lt;br /&gt;108.	Security types in ASP/ASP.NET? Different Authentication modes? &lt;br /&gt;109.	How .Net has implemented security for web applications? &lt;br /&gt;110.	How to do Forms authentication in asp.net? &lt;br /&gt;111.	Explain authentication levels in .net ? &lt;br /&gt;112.	Explain autherization levels in .net ? &lt;br /&gt;113.	What is Role-Based security?&lt;br /&gt;A role is a named set of principals that have the same privileges with respect to security (such as a teller or a manager). A principal can be a member of one or more roles. Therefore, applications can use role membership to determine whether a principal is authorized to perform a requested action. &lt;br /&gt;** &lt;br /&gt;114.	How will you do windows authentication and what is the namespace? If a user is logged under integrated windows authentication mode, but he is still not able to logon, what might be the possible cause for this? In ASP.Net application how do you find the name of the logged in person under windows authentication? &lt;br /&gt;115.	What are the different authentication modes in the .NET environment?&lt;br /&gt;116.	&lt;authentication mode=&quot;Windows|Forms|Passport|None&quot;&gt;&lt;br /&gt;117.	   &lt;forms name=&quot;name&quot;&lt;br /&gt;118.	                      loginUrl=&quot;url&quot; &lt;br /&gt;119.	                      protection=&quot;All|None|Encryption|Validation&quot;&lt;br /&gt;120.	                      timeout=&quot;30&quot; path=&quot;/&quot; &gt;&lt;br /&gt;121.	                      requireSSL=&quot;true|false&quot;&lt;br /&gt;122.	                      slidingExpiration=&quot;true|false&quot;&gt;&lt;br /&gt;123.	      &lt;credentials passwordFormat=&quot;Clear|SHA1|MD5&quot;&gt;&lt;br /&gt;124.	         &lt;user name=&quot;username&quot; password=&quot;password&quot;/&gt;&lt;br /&gt;125.	      &lt;/credentials&gt;&lt;br /&gt;126.	                 &lt;/forms&gt;&lt;br /&gt;127.	   &lt;passport redirectUrl=&quot;internal&quot;/&gt;&lt;br /&gt;&lt;/authentication&gt;&lt;br /&gt;Attribute	Option	Description&lt;br /&gt;mode	   	Controls the default authentication mode for an application.&lt;br /&gt;   	Windows	Specifies Windows authentication as the default authentication mode. Use this mode when using any form of Microsoft Internet Information Services (IIS) authentication: Basic, Digest, Integrated Windows authentication (NTLM/Kerberos), or certificates.&lt;br /&gt;   	Forms	Specifies ASP.NET forms-based authentication as the default authentication mode.&lt;br /&gt;   	Passport	Specifies Microsoft Passport authentication as the default authentication mode.&lt;br /&gt;   	None	Specifies no authentication. Only anonymous users are expected or applications can handle events to provide their own authentication.&lt;br /&gt;128.	How do you specify whether your data should be passed as Query string and Forms (Mainly about POST and GET)&lt;br /&gt;Through attribute tag of form tag. &lt;br /&gt;129.	What is the other method, other than GET and POST, in ASP.NET? &lt;br /&gt;130.	What are validator? Name the Validation controls in asp.net? How do u disable them? Will the asp.net validators run in server side or client side? How do you do Client-side validation in .Net? How to disable validator control by client side JavaScript?&lt;br /&gt;A set of server controls included with ASP.NET that test user input in HTML and Web server controls for programmer-defined requirements. Validation controls perform input checking in server code. If the user is working with a browser that supports DHTML, the validation controls can also perform validation (&quot;EnableClientScript&quot; property set to true/false) using client script.&lt;br /&gt;The following validation controls are available in asp.net:&lt;br /&gt;RequiredFieldValidator Control, CompareValidator Control, RangeValidator Control, RegularExpressionValidator Control, CustomValidator Control, ValidationSummary Control. &lt;br /&gt;131.	Which two properties are there on every validation control?&lt;br /&gt;ControlToValidate, ErrorMessage &lt;br /&gt;132.	How do you use css in asp.net?&lt;br /&gt;Within the &lt;HEAD&gt; section of an HTML document that will use these styles, add a link to this external CSS style sheet that &lt;br /&gt;follows this form: &lt;br /&gt;&lt;LINK REL=&quot;STYLESHEET&quot; TYPE=&quot;text/css&quot; HREF=&quot;MyStyles.css&quot;&gt; &lt;br /&gt;MyStyles.css is the name of your external CSS style sheet. &lt;br /&gt;133.	How do you implement postback with a text box? What is postback and usestate?&lt;br /&gt;Make AutoPostBack property to true &lt;br /&gt;134.	How can you debug an ASP page, without touching the code? &lt;br /&gt;135.	What is SQL injection?&lt;br /&gt;An SQL injection attack &quot;injects&quot; or manipulates SQL code by adding unexpected SQL to a query.&lt;br /&gt;Many web pages take parameters from web user, and make SQL query to the database. Take for instance when a user login, web page that user name and password and make SQL query to the database to check if a user has valid name and password.&lt;br /&gt;Username: &#39; or 1=1 --- &lt;br /&gt;Password: [Empty]&lt;br /&gt;This would execute the following query against the users table: &lt;br /&gt;select count(*) from users where userName=&#39;&#39; or 1=1 --&#39; and userPass=&#39;&#39; &lt;br /&gt;136.	How can u handle Exceptions in Asp.Net? &lt;br /&gt;137.	How can u handle Un Managed Code Exceptions in ASP.Net? &lt;br /&gt;138.	Asp.net - How to find last error which occurred?&lt;br /&gt;A: Server.GetLastError();&lt;br /&gt;[C#]&lt;br /&gt;Exception LastError;&lt;br /&gt;String ErrMessage;&lt;br /&gt;LastError = Server.GetLastError();&lt;br /&gt;if (LastError != null)&lt;br /&gt;ErrMessage = LastError.Message;&lt;br /&gt;else&lt;br /&gt;ErrMessage = &quot;No Errors&quot;;&lt;br /&gt;Response.Write(&quot;Last Error = &quot; + ErrMessage); &lt;br /&gt;139.	How to do Caching in ASP?&lt;br /&gt;A: &lt;%@ OutputCache Duration=&quot;60&quot; VaryByParam=&quot;None&quot; %&gt; &lt;br /&gt;VaryByParam value	Description&lt;br /&gt;None	One version of page cached (only raw GET)&lt;br /&gt;*	n versions of page cached based on query string and/or POST body&lt;br /&gt;v1	n versions of page cached based on value of v1 variable in query string or POST body&lt;br /&gt;v1;v2	n versions of page cached based on value of v1 and v2 variables in query string or POST body&lt;br /&gt;140.	&lt;%@ OutputCache Duration=&quot;60&quot; VaryByParam=&quot;none&quot; %&gt;&lt;br /&gt;&lt;%@ OutputCache Duration=&quot;60&quot; VaryByParam=&quot;*&quot; %&gt;&lt;br /&gt;&lt;%@ OutputCache Duration=&quot;60&quot; VaryByParam=&quot;name;age&quot; %&gt;&lt;br /&gt;The OutputCache directive supports several other cache varying options &lt;br /&gt;•	VaryByHeader - maintain separate cache entry for header string changes (UserAgent, UserLanguage, etc.) &lt;br /&gt;•	VaryByControl - for user controls, maintain separate cache entry for properties of a user control &lt;br /&gt;•	VaryByCustom - can specify separate cache entries for browser types and version or provide a custom GetVaryByCustomString method in HttpApplicationderived class &lt;br /&gt;141.	What is the Global ASA(X) File? &lt;br /&gt;142.	Any alternative to avoid name collisions other then Namespaces.&lt;br /&gt;A scenario that two namespaces named N1 and N2 are there both having the same class say A. now in another class i ve written &lt;br /&gt;using N1;using N2;&lt;br /&gt;and i am instantiating class A in this class. Then how will u avoid name collisions?&lt;br /&gt;Ans: using alias&lt;br /&gt;Eg: using MyAlias = MyCompany.Proj.Nested; &lt;br /&gt;143.	Which is the namespace used to write error message in event Log File? &lt;br /&gt;144.	What are the page level transaction and class level transaction? &lt;br /&gt;145.	What are different transaction options? &lt;br /&gt;146.	What is the namespace for encryption? &lt;br /&gt;147.	What is the difference between application and cache variables? &lt;br /&gt;148.	What is the difference between control and component? &lt;br /&gt;149.	You ve defined one page_load event in aspx page and same page_load event in code behind how will prog run? &lt;br /&gt;150.	Where would you use an IHttpModule, and what are the limitations of any approach you might take in implementing one? &lt;br /&gt;151.	Can you edit data in the Repeater control? Which template must you provide, 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, and what method must you call in your code, in order to bind the data from some data source to the Repeater control? &lt;br /&gt;152.	What is the use of web.config? Difference between machine.config and Web.config?&lt;br /&gt;ASP.NET configuration files are XML-based text files--each named web.config--that can appear in any directory on an ASP.NET Web application server. Each web.config file applies configuration settings to the directory it is located in and to all virtual child directories beneath it. Settings in child directories can optionally override or modify settings specified in parent directories. The root configuration file-- inNT\Microsoft.NET\Framework\&lt;version&gt;\config\machine.config--provides &lt;br /&gt;default configuration settings for the entire machine. ASP.NET configures IIS to prevent direct browser access to web.config  files to ensure that their values cannot become public (attempts to access them will cause ASP.NET to return 403: Access Forbidden). &lt;br /&gt;At run time ASP.NET uses these web.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; ASP.NET automatically watches for file changes and will invalidate the cache if any of the configuration files change). &lt;br /&gt;http://samples.gotdotnet.com/quickstart/aspplus/doc/configformat.aspx &lt;br /&gt;153.	What is the use of sessionstate tag in the web.config file?&lt;br /&gt;Configuring session state: Session state features can be configured via the &lt;sessionState&gt; section in a web.config file. To double the default timeout of 20 minutes, you can add the following to the web.config file of an application: &lt;br /&gt;&lt;sessionState&lt;br /&gt;timeout=&quot;40&quot;&lt;br /&gt;/&gt; &lt;br /&gt;154.	What are the different modes for the sessionstates in the web.config file? &lt;br /&gt;Off	Indicates that session state is not enabled.&lt;br /&gt;Inproc	Indicates that session state is stored locally.&lt;br /&gt;StateServer	Indicates that session state is stored on a remote server.&lt;br /&gt;SQLServer	Indicates that session state is stored on the SQL Server.&lt;br /&gt;155.	What is smart navigation?&lt;br /&gt;When a page is requested by an Internet Explorer 5 browser, or later, smart navigation enhances the user&#39;s experience of the page by performing the following: &lt;br /&gt;•	eliminating the flash caused by navigation. &lt;br /&gt;•	persisting the scroll position when moving from page to page. &lt;br /&gt;•	persisting element focus between navigations. &lt;br /&gt;•	retaining only the last page state in the browser&#39;s history. &lt;br /&gt;Smart navigation is best used with ASP.NET pages that require frequent postbacks but with visual content that does not change dramatically on return. Consider this carefully when deciding whether to set this property to true.&lt;br /&gt;Set the SmartNavigation attribute to true in the @ Page directive in the .aspx file. When the page is requested, the dynamically generated class sets this property. &lt;br /&gt;156.	In what order do the events of an ASPX page execute. As a developer is it important to undertsand these events? &lt;br /&gt;157.	How would you get ASP.NET running in Apache web servers - why would you even do this? &lt;br /&gt;158.	What tags do you need to add within the asp:datagrid tags to bind columns manually &lt;br /&gt;159.	What base class do all Web Forms inherit from?&lt;br /&gt;System.Web.UI.Page &lt;br /&gt;160.	How can we create pie chart in asp.net? &lt;br /&gt;161.	Is it possible for me to change my aspx file extension to some other name?&lt;br /&gt;Yes.&lt;br /&gt;Open IIS-&gt;Default Website -&gt; Properties&lt;br /&gt;Select HomeDirectory tab&lt;br /&gt;Click on configuration button&lt;br /&gt;Click on add. Enter aspnet_isapi details (C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\aspnet_isapi.dll   |  GET,HEAD,POST,DEBUG)&lt;br /&gt;&lt;br /&gt;Open machine.config(C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\CONFIG) &amp; add new extension under &lt;httpHandlers&gt; tag&lt;br /&gt;&lt;add verb=&quot;*&quot; path=&quot;*.santhosh&quot; type=&quot;System.Web.UI.PageHandlerFactory&quot;/&gt; &lt;br /&gt;162.	What is AutoEventWireup attribute for ?&lt;br /&gt;&lt;br /&gt;(WEBSERVICE &amp; REMOTING) &lt;br /&gt;163.	What is a WebService and what is the underlying protocol used in it?Why Web Services?&lt;br /&gt;Web Services are applications delivered as a service on the Web. Web services allow for programmatic access of business logic over the Web. Web services typically rely on XML-based protocols, messages, and interface descriptions for communication and access. Web services are designed to be used by other programs or applications rather than directly by end user. Programs invoking a Web service are called clients. SOAP over HTTP is the most commonly used protocol for invoking Web services.&lt;br /&gt;There are three main uses of Web services. &lt;br /&gt;0.	Application integration Web services within an intranet are commonly used to integrate business applications running on disparate platforms. For example, a .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. &lt;br /&gt;1.	Business integration Web services allow trading partners to engage in e-business leveraging the existing Internet infrastructure. Organizations can send electronic purchase orders to suppliers and receive electronic invoices. 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. &lt;br /&gt;2.	Commercial Web services focus on selling content and business services to clients over the Internet similar to familiar Web pages. Unlike Web pages, commercial Web services target applications not humans as their direct users. Continental Airlines exposes flight schedules and status Web services for travel Web sites and agencies to use in their applications. Like Web pages, commercial Web services are valuable only if they expose a valuable service or content. It would be very difficult to get customers to pay you for using a Web service that creates business charts with the customers? data. Customers would rather buy a charting component (e.g. COM or .NET component) and install it on the same machine as their application. On the other hand, it makes sense to sell real-time weather information or stock quotes as a Web service. Technology can help you add value to your services and explore new markets, but ultimately customers pay for contents and/or business services, not for technology &lt;br /&gt;164.	Are Web Services a replacement for other distributed computing platforms?&lt;br /&gt;No. Web Services is just a new way of looking at existing implementation platforms. &lt;br /&gt;165.	In a Webservice, need to display 10 rows from a table. So DataReader or DataSet is best choice?&lt;br /&gt;A: WebService will support only DataSet. &lt;br /&gt;166.	How to generate WebService proxy? What is SOAP, WSDL, UDDI and the concept behind Web Services? What are various components of WSDL? What is the use of WSDL.exe utility?&lt;br /&gt;SOAP is an XML-based messaging framework specifically designed for exchanging formatted data across the Internet, for example using request and reply messages or sending entire documents. SOAP is simple, easy to use, and completely neutral with respect to operating system, programming language, or distributed computing platform.&lt;br /&gt;After SOAP became available as a mechanism for exchanging XML messages among enterprises (or among disparate applications within the same enterprise), a better way was needed to describe the messages and how they are exchanged. The Web Services Description Language (WSDL) is a particular form of an XML Schema, developed by Microsoft and IBM for the purpose of defining the XML message, operation, and protocol mapping of a web service accessed using SOAP or other XML protocol. WSDL defines web services in terms of &quot;endpoints&quot; that operate on XML messages. The WSDL syntax allows both the messages and the operations on the messages to be defined abstractly, so they can be mapped to multiple physical implementations. The current WSDL spec describes how to map messages and operations to SOAP 1.1, HTTP GET/POST, and MIME. WSDL creates web service definitions by mapping a group of endpoints into a logical sequence of operations on XML messages. The same XML message can be mapped to multiple operations (or services) and bound to one or more communications protocols (using &quot;ports&quot;).&lt;br /&gt;The Universal Description, Discovery, and Integration (UDDI) framework defines a data model (in XML) and SOAP APIs for registration and searches on business information, including the web services a business exposes to the Internet. UDDI is an independent consortium of vendors, founded by Microsoft, IBM, and Ariba, for the purpose of developing an Internet standard for web service description registration and discovery. Microsoft, IBM, and Ariba also are hosting the initial deployment of a UDDI service, which is conceptually patterned after DNS (the Internet service that translates URLs into TCP addresses). UDDI uses a private agreement profile of SOAP (i.e. UDDI doesn&#39;t use the SOAP serialization format because it&#39;s not well suited to passing complete XML documents (it&#39;s aimed at RPC style interactions). The main idea is that businesses use the SOAP APIs to register themselves with UDDI, and other businesses search UDDI when they want to discover a trading partner, for example someone from whom they wish to procure sheet metal, bolts, or transistors. The information in UDDI is categorized according to industry type and geographical location, allowing UDDI consumers to search through lists of potentially matching businesses to find the specific one they want to contact. Once a specific business is chosen, another call to UDDI is made to obtain the specific contact information for that business. The contact information includes a pointer to the target business&#39;s WSDL or other XML schema file describing the web service that the target business publishes. &lt;br /&gt;167.	How to generate proxy class other than .net app and wsdl tool?&lt;br /&gt;To access an XML Web service from a client application, you first add a Web reference, which is a reference to an XML Web service. When you create a Web reference, Visual Studio creates an XML Web service proxy class automatically and adds it to your project. 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. Visual Studio uses the Web Services Description Language (WSDL) to create the proxy.&lt;br /&gt;To generate an XML Web service proxy class: &lt;br /&gt;•	From a command prompt, use Wsdl.exe to create a proxy class, specifying (at a minimum) the URL to an XML Web service or a service description, or the path to a saved service description.&lt;br /&gt;Wsdl /language:language  /protocol:protocol /namespace:myNameSpace /out:filename&lt;br /&gt;/username:username /password:password /domain:domain &lt;url or path&gt; &lt;br /&gt;168.	What is a proxy in web service? How do I use a proxy server when invoking a Web service? &lt;br /&gt;  &lt;br /&gt;169.	asynchronous web service means? &lt;br /&gt;170.	What are the events fired when web service called? &lt;br /&gt;171.	How will do transaction in Web Services? &lt;br /&gt;172.	How does SOAP transport happen and what is the role of HTTP in it? How you can access a webservice using soap? &lt;br /&gt;173.	What are the different formatters can be used in both? Why?.. binary/soap &lt;br /&gt;174.	How you will protect / secure a web service?&lt;br /&gt;For the most part, things that you do to secure a Web site can be used to secure a Web Service. If you need to encrypt the data exchange, you use Secure Sockets Layer (SSL) or a Virtual Private Network to keep the bits secure. For authentication, use HTTP Basic or Digest authentication with Microsoft® Windows® integration to figure out who the caller is.&lt;br /&gt;these items cannot: &lt;br /&gt;•	Parse a SOAP request for valid values &lt;br /&gt;•	Authenticate access at the Web Method level (they can authenticate at the Web Service level) &lt;br /&gt;•	Stop reading a request as soon as it is recognized as invalid &lt;br /&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpcontransactionsupportinaspnetwebservices.asp &lt;br /&gt;175.	How will you expose/publish a webservice? &lt;br /&gt;176.	What is disco file? &lt;br /&gt;177.	What’s the attribute for webservice method? What is the namespace for creating webservice?&lt;br /&gt;[WebMethod]&lt;br /&gt;&lt;br /&gt;using System.Web;&lt;br /&gt;using System.Web.Services; &lt;br /&gt;178.	What is Remoting? &lt;br /&gt;The process of communication between different operating system processes, regardless of whether they are on the same computer. The .NET remoting system is an architecture designed to simplify communication between objects living in different application domains, whether on the same computer or not, and between different contexts, whether in the same application domain or not. &lt;br /&gt;179.	Difference between web services &amp; remoting? &lt;br /&gt; 	ASP.NET Web Services	.NET Remoting&lt;br /&gt;Protocol 	Can be accessed only over HTTP	Can be accessed over any protocol (including TCP, HTTP, SMTP and so on)&lt;br /&gt;State Management 	Web services work in a stateless environment	Provide support for both stateful and stateless environments through Singleton and SingleCall objects&lt;br /&gt;Type System 	Web services support only the datatypes defined in the XSD type system, limiting the number of objects that can be serialized. 	Using binary communication, .NET Remoting can provide support for rich type system&lt;br /&gt;Interoperability 	Web services support interoperability across platforms, and are ideal for heterogeneous environments. 	.NET remoting requires the client be built using .NET, enforcing homogenous environment. &lt;br /&gt;Reliability 	Highly reliable due to the fact that Web services are always hosted in IIS	Can also take advantage of IIS for fault isolation. If IIS is not used, application needs to provide plumbing for ensuring the reliability of the application. &lt;br /&gt;Extensibility 	Provides extensibility by allowing us to intercept the SOAP messages during the serialization and deserialization stages. 	Very extensible by allowing us to customize the different components of the .NET remoting framework. &lt;br /&gt;Ease-of-Programming 	Easy-to-create and deploy. 	Complex to program. &lt;br /&gt;180.	Though both the .NET Remoting infrastructure and ASP.NET Web services can enable cross-process communication, each is designed to benefit a different target audience. ASP.NET Web services provide a simple programming model and a wide reach. .NET Remoting provides a more complex programming model and has a much narrower reach.&lt;br /&gt;As explained before, the clear performance advantage provided by TCPChannel-remoting should make you think about using this channel whenever you can afford to do so. If you can create direct TCP connections from your clients to your server and if you need to support only the .NET platform, you should go for this channel. If you are going to go cross-platform or you have the requirement of supporting SOAP via HTTP, you should definitely go for ASP.NET Web services.&lt;br /&gt;Both the .NET remoting and ASP.NET Web services are powerful technologies that provide a suitable framework for developing distributed applications. It is important to understand how both technologies work and then choose the one that is right for your application. For applications that require interoperability and must function over public networks, Web services are probably the best bet. For those that require communications with other .NET components and where performance is a key priority, .NET Remoting is the best choice. In short, use Web services when you need to send and receive data from different computing platforms, use .NET Remoting when sending and receiving data between .NET applications. In some architectural scenarios, you might also be able to use.NET Remoting in conjunction with ASP.NET Web services and take advantage of the best of both worlds.&lt;br /&gt;The Key difference between ASP.NET webservices and .NET Remoting is how they serialize data into messages and the format they choose for metadata.  ASP.NET uses XML serializer for serializing or Marshalling. And XSD is used for Metadata.  .NET Remoting relies on System.Runtime.Serialization.Formatter.Binary and System.Runtime.Serialization.SOAPFormatter and relies on .NET CLR Runtime assemblies for metadata. &lt;br /&gt;181.	Can you pass SOAP messages through remoting? &lt;br /&gt;182.	CAO and SAO.&lt;br /&gt;Client Activated objects are those remote objects whose Lifetime is directly Controlled by the client. This is in direct contrast to SAO. Where the server, not the client has complete control over the lifetime of the objects. &lt;br /&gt;Client activated objects are instantiated on the server as soon as the client request the object to be created. Unlike as SAO a CAO doesn’t delay the object creation until the first method is called on the object. (In SAO the object is instantiated when the client calls the method on the object) &lt;br /&gt;183.	singleton and singlecall.&lt;br /&gt;Singleton types never have more than one instance at any one time. If an instance exists, all client requests are serviced by that instance.&lt;br /&gt;Single Call types always have one instance per client request. The next method invocation will be serviced by a different server instance, even if the previous instance has not yet been recycled by the system. &lt;br /&gt;184.	What is Asynchronous Web Services? &lt;br /&gt;185.	Web Client class and its methods? &lt;br /&gt;186.	Flow of remoting? &lt;br /&gt;187.	What is the use of trace utility?&lt;br /&gt;Using the SOAP Trace Utility&lt;br /&gt;The Microsoft® Simple Object Access Protocol (SOAP) Toolkit 2.0 includes a TCP/IP trace utility, MSSOAPT.EXE. You use this trace utility to view the SOAP messages sent by HTTP between a SOAP client and a service on the server. &lt;br /&gt;Using the Trace Utility on the Server&lt;br /&gt;To see all of a service&#39;s messages received from and sent to all clients, perform the following steps on the server. &lt;br /&gt;0.	On the server, open the Web Services Description Language (WSDL) file. &lt;br /&gt;1.	In the WSDL file, locate the &lt;soap:address&gt; element that corresponds to the service and change the location attribute for this element to port 8080. For example, if the location attribute specifies &lt;http://MyServer/VDir/Service.wsdl&gt; change this attribute to &lt;http://MyServer:8080/VDir/Service.wsdl&gt;. &lt;br /&gt;2.	Run MSSOAPT.exe. &lt;br /&gt;3.	On the File menu, point to New, and either click Formatted Trace (if you don&#39;t want to see HTTP headers) or click Unformatted Trace (if you do want to see HTTP headers). &lt;br /&gt;4.	In the Trace Setup dialog box, click OK to accept the default values. &lt;br /&gt;Using the Trace Utility on the Client&lt;br /&gt;To see all messages sent to and received from a service, do the following steps on the client. &lt;br /&gt;5.	Copy the WSDL file from the server to the client. &lt;br /&gt;6.	Modify location attribute of the &lt;soap:address&gt; element in the local copy of the WSDL document to direct the client to localhost:8080 and make a note of the current host and port. For example, if the WSDL contains &lt;http://MyServer/VDir/Service.wsdl&gt;, change it to &lt;http://localhost:8080/VDir/Service.wsdl&gt; and make note of &quot;MyServer&quot;. &lt;br /&gt;7.	On the client, run MSSOPT.exe. &lt;br /&gt;8.	On the File menu, point to New, and either click Formatted Trace (if you don&#39;t want to see HTTP headers) or click Unformatted Trace (if you do want to see HTTP headers). &lt;br /&gt;9.	In the Destination host box, enter the host specified in Step 2. &lt;br /&gt;10.	In the Destination port box, enter the port specified in Step 2. &lt;br /&gt;11.	 Click OK. &lt;br /&gt;&lt;br /&gt;(XML)&lt;br /&gt;188.	Explain the concept of data island? &lt;br /&gt;189.	How to use XML DOM model on client side using JavaScript. &lt;br /&gt;190.	What are the ways to create a tree view control using XML, XSL &amp; JavaScript? &lt;br /&gt;191.	Questions on XPathNavigator, and the other classes in System.XML Namespace? &lt;br /&gt;192.	What is Use of Template in XSL? &lt;br /&gt;193.	What is “Well Formed XML” and “Valid XML” &lt;br /&gt;194.	How you will do SubString in XSL &lt;br /&gt;195.	Can we do sorting in XSL ? how do you deal sorting columns dynamically in XML. &lt;br /&gt;196.	What is “Async” property of XML Means ? &lt;br /&gt;197.	What is XPath Query ? &lt;br /&gt;198.	Difference Between Element and Node. &lt;br /&gt;199.	What is CDATA Section. &lt;br /&gt;200.	DOM &amp; SAX parsers explanation and difference &lt;br /&gt;201.	What is GetElementbyname method will do? &lt;br /&gt;202.	What is selectnode method will give? &lt;br /&gt;203.	What is valid xml document? What a well formed xml document? &lt;br /&gt;204.	What is the Difference between XmlDocument and XmlDataDocument? &lt;br /&gt;205.	Explain what a DiffGram is, and a good use for one?&lt;br /&gt;A DiffGram is an XML format that is used to identify current and original versions of data elements. When sending and retrieving a DataSet from an XML Web service, the DiffGram format is implicitly used.&lt;br /&gt;The DataSet uses the DiffGram format to load and persist its contents, and to serialize its contents for transport across a network connection. When a DataSet is written as a DiffGram, it populates the DiffGram with all the necessary information to accurately recreate the contents, though not the schema, of the DataSet, including column values from both the Original and Current row versions, row error information, and row order.&lt;br /&gt;DiffGram Format&lt;br /&gt;The DiffGram format is divided into three sections: the current data, the original (or &quot;before&quot;) data, and an errors section, as shown in the following example. &lt;br /&gt;&lt;?xml version=&quot;1.0&quot;?&gt;&lt;br /&gt;&lt;diffgr:diffgram&lt;br /&gt;xmlns:msdata=&quot;urn:schemas-microsoft-com:xml-msdata&quot;&lt;br /&gt;xmlns:diffgr=&quot;urn:schemas-microsoft-com:xml-diffgram-v1&quot;&lt;br /&gt;xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;DataInstance&gt;&lt;br /&gt;&lt;/DataInstance&gt;&lt;br /&gt;&lt;br /&gt;&lt;diffgr:before&gt;&lt;br /&gt;&lt;/diffgr:before&gt;&lt;br /&gt;&lt;br /&gt;&lt;diffgr:errors&gt;&lt;br /&gt;&lt;/diffgr:errors&gt;&lt;br /&gt;&lt;/diffgr:diffgram&gt;&lt;br /&gt;The DiffGram format consists of the following blocks of data: &lt;br /&gt;&lt;DataInstance&gt; &lt;br /&gt;The name of this element, DataInstance, is used for explanation purposes in this documentation. A DataInstance element represents a DataSet or a row of a DataTable. Instead of DataInstance, the element would contain the name of the DataSet or DataTable. This block of the DiffGram format contains the current data, whether it has been modified or not. An element, or row, that has been modified is identified with the diffgr:hasChanges annotation. &lt;br /&gt;&lt;diffgr:before&gt; &lt;br /&gt;This block of the DiffGram format contains the original version of a row. Elements in this block are matched to elements in the DataInstance block using the diffgr:id annotation. &lt;br /&gt;&lt;diffgr:errors&gt; &lt;br /&gt;This block of the DiffGram format contains error information for a particular row in the DataInstance block. Elements in this block are matched to elements in the DataInstance block using the diffgr:id annotation. &lt;br /&gt;206.	If I replace my Sqlserver with XML files and how about handling the same? &lt;br /&gt;207.	Write syntax to serialize class using XML Serializer?&lt;br /&gt;&lt;br /&gt;(IIS) &lt;br /&gt;208.	In which process does IIS runs (was asking about the EXE file)&lt;br /&gt;inetinfo.exe is the Microsoft IIS server running, handling ASP.NET requests among other things.  When an ASP.NET request is received (usually a file with .aspx extension), the ISAPI filter aspnet_isapi.dll takes care of it by passing the request to the actual worker process aspnet_wp.exe. &lt;br /&gt;209.	Where are the IIS log files stored?&lt;br /&gt;C:\WINDOWS\system32\Logfiles\W3SVC1&lt;br /&gt;    OR&lt;br /&gt;c:\winnt\system32\LogFiles\W3SVC1 &lt;br /&gt;210.	What are the different IIS authentication modes in IIS 5.0 and Explain? Difference between basic and digest authentication modes?&lt;br /&gt;IIS provides a variety of authentication schemes: &lt;br /&gt;•	Anonymous (enabled by default) &lt;br /&gt;•	Basic &lt;br /&gt;•	Digest &lt;br /&gt;•	Integrated Windows authentication (enabled by default) &lt;br /&gt;•	Client Certificate Mapping &lt;br /&gt;Anonymous&lt;br /&gt;Anonymous authentication gives users access to the public areas of your Web site without prompting them for a user name or password. Although listed as an authentication scheme, it is not technically performing any client authentication because the client is not required to supply any credentials. Instead, IIS provides stored credentials to Windows using a special user account, IUSR_machinename. By default, IIS controls the password for this account. Whether or not IIS controls the password affects the permissions the anonymous user has. When IIS controls the password, a sub authentication DLL (iissuba.dll) authenticates the user using a network logon. The function of this DLL is to validate the password supplied by IIS and to inform Windows that the password is valid, thereby authenticating the client. However, it does not actually provide a password to Windows. When IIS does not control the password, IIS calls the LogonUser() API in Windows and provides the account name, password and domain name to log on the user using a local logon. After the logon, IIS caches the security token and impersonates the account. A local logon makes it possible for the anonymous user to access network resources, whereas a network logon does not.&lt;br /&gt;Basic Authentication &lt;br /&gt;IIS Basic authentication as an implementation of the basic authentication scheme found in section 11 of the HTTP 1.0 specification. &lt;br /&gt;As the specification makes clear, this method is, in and of itself, non-secure. The reason is that Basic authentication assumes a trusted connection between client and server. Thus, the username and password are transmitted in clear text. More specifically, they are transmitted using Base64 encoding, which is trivially easy to decode. This makes Basic authentication the wrong choice to use over a public network on its own. &lt;br /&gt;Basic Authentication is a long-standing standard supported by nearly all browsers. It also imposes no special requirements on the server side -- users can authenticate against any NT domain, or even against accounts on the local machine. With SSL to shelter the security credentials while they are in transmission, you have an authentication solution that is both highly secure and quite flexible. &lt;br /&gt;Digest Authentication &lt;br /&gt;The Digest authentication option was added in Windows 2000 and IIS 5.0. Like Basic authentication, this is an implementation of a technique suggested by Web standards, namely RFC 2069 (superceded by RFC 2617). &lt;br /&gt;Digest authentication also uses a challenge/response model, but it is much more secure than Basic authentication (when used without SSL). It achieves this greater security not by encrypting the secret (the password) before sending it, but rather by following a different design pattern -- one that does not require the client to transmit the password over the wire at all. &lt;br /&gt;Instead of sending the password itself, the client transmits a one-way message digest (a checksum) of the user&#39;s password, using (by default) the MD5 algorithm. The server then fetches the password for that user from a Windows 2000 Domain Controller, reruns the checksum algorithm on it, and compares the two digests. If they match, the server knows that the client knows the correct password, even though the password itself was never sent. (If you have ever wondered what the default ISAPI filter &quot;md5filt&quot; that is installed with IIS 5.0 is used for, now you know.&lt;br /&gt;Integrated Windows Authentication&lt;br /&gt;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.0 and later. &lt;br /&gt;When Internet Explorer attempts to access a protected resource, IIS sends two WWW-Authenticate headers, Negotiate and NTLM. &lt;br /&gt;•	If Internet Explorer recognizes the Negotiate header, it will choose it because it is listed first. When using Negotiate, the browser will return information for both NTLM and Kerberos. At the server, IIS will use Kerberos if both the client (Internet Explorer 5.0 and later) and server (IIS 5.0 and later) are running Windows 2000 and later, and both are members of the same domain or trusted domains. Otherwise, the server will default to using NTLM. &lt;br /&gt;•	If Internet Explorer does not understand Negotiate, it will use NTLM. &lt;br /&gt;So, which mechanism is used depends upon a negotiation between Internet Explorer and IIS. &lt;br /&gt;When used in conjunction with Kerberos v5 authentication, IIS can delegate security credentials among computers running Windows 2000 and later that are trusted and configured for delegation. Delegation enables remote access of resources on behalf of the delegated user. &lt;br /&gt;Integrated Windows authentication is the best authentication scheme in an intranet environment where users have Windows domain accounts, especially when using Kerberos. Integrated Windows authentication, like digest authentication, does not pass the user&#39;s password across the network. Instead, a hashed value is exchanged.&lt;br /&gt;Client Certificate Mapping &lt;br /&gt;A certificate is a digitally signed statement that contains information about an entity and the entity&#39;s public key, thus binding these two pieces of information together. 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. Certificates can contain different types of data. For example, an X.509 certificate includes the format of the certificate, the serial number of the certificate, the algorithm used to sign the certificate, the name of the CA that issued the certificate, the name and public key of the entity requ`esting the certificate, and the CA&#39;s signature. X.509 client certificates simplify authentication for larger user bases because they do not rely on a centralized account database. You can verify a certificate simply by examining the certificate.&lt;br /&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsent7/html/vxconIISAuthentication.asp &lt;br /&gt;211.	How to configure the sites in Web server (IIS)? &lt;br /&gt;212.	Advantages in IIS 6.0?&lt;br /&gt;http://www.microsoft.com/windowsserver2003/iis/evaluation/features/default.mspx &lt;br /&gt;http://www.microsoft.com/technet/treeview/default.asp?url=/technet/prodtechnol/windowsserver2003/proddocs/datacenter/gs_whatschanged.asp &lt;br /&gt;213.	IIS Isolation Levels?&lt;br /&gt;Internet Information Server introduced the notion &quot;Isolation Level&quot;, which is also present in IIS4 under a different name. IIS5 supports three isolation levels, that you can set from the Home Directory tab of the site&#39;s Properties dialog: &lt;br /&gt;•	Low (IIS Process): ASP pages run in INetInfo.Exe, the main IIS process, therefore they are executed in-process. This is the fastest setting, and is the default under IIS4. The problem is that if ASP crashes, IIS crashes as well and must be restarted (IIS5 has a reliable restart feature that automatically restarts a server when a fatal error occurs). &lt;br /&gt;•	Medium (Pooled): In this case ASP runs in a different process, which makes this setting more reliable: if ASP crashes IIS won&#39;t. All the ASP applications at the Medium isolation level share the same process, so you can have a web site running with just two processes (IIS and ASP process). IIS5 is the first Internet Information Server version that supports this setting, which is also the default setting when you create an IIS5 application. Note that an ASP application that runs at this level is run under COM+, so it&#39;s hosted in DLLHOST.EXE (and you can see this executable in the Task Manager). &lt;br /&gt;•	High (Isolated): Each ASP application runs out-process in its own process space, therefore if an ASP application crashes, neither IIS nor any other ASP application will be affected. 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.EXE, while under IIS5 it runs inside DLLHOST.EXE. &lt;br /&gt;When selecting an isolation level for your ASP application, keep in mind that out-process settings - that is, Medium and High - are less efficient than in-process (Low). However, out-process communication has been vastly improved under IIS5, and in fact IIS5&#39;s Medium isolation level often deliver better results than IIS4&#39;s Low isolation. In practice, you shouldn&#39;t set the Low isolation level for an IIS5 application unless you really need to serve hundreds pages per second. &lt;br /&gt;Controls &lt;br /&gt;214.	How will you do Redo and Undo in a TextControl? &lt;br /&gt;215.	How to implement DataGrid in .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, what is the access specifier used for that methods in the code behind file and why? &lt;br /&gt;216.	How can we create Tree control in asp.net?&lt;br /&gt;&lt;br /&gt;Programming &lt;br /&gt;217.	Write a program in C# for checking a given number is PRIME or not. &lt;br /&gt;218.	Write a program to find the angle between the hours and minutes in a clock &lt;br /&gt;219.	Write a C# program to find the Factorial of n &lt;br /&gt;220.	How do I upload a file from my ASP.NET page?&lt;br /&gt;A: In order to perform file upload in your ASP.NET page, you will need to use two classes: the System.Web.UI.HtmlControls.HtmlInputFile class and the System.Web.HttpPostedFile class. The HtmlInputFile class represents and HTML input control that the user will use on the client side to select a file to upload. 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, you need to add the enctype attribute to your form tag as follows:&lt;br /&gt;&lt;form id=&quot;upload&quot; method=&quot;post&quot; runat=&quot;server&quot; enctype=&quot;multipart/form-data&quot;&gt;&lt;br /&gt;Also, remember that the /data directory is the only directory with Write permissions enabled for the anonymous user. Therefore, you will need to make sure that the your code uploads the file to the /data directory or one of its subdirectories.&lt;br /&gt;Below is a simple example of how to upload a file via an ASP.NET page in C# and VB.NET.&lt;br /&gt;C#&lt;br /&gt;&lt;%@ Import Namespace=&quot;System&quot; %&gt;&lt;br /&gt;&lt;%@ Import Namespace=&quot;System.Web&quot; %&gt;&lt;br /&gt;&lt;%@ Import Namespace=&quot;System.Web.UI.HtmlControls&quot; %&gt;&lt;br /&gt;&lt;%@ Import Namespace=&quot;System.IO&quot; %&gt;&lt;br /&gt;&lt;%@ Import Namespace=&quot;System.Drawing&quot; %&gt;&lt;br /&gt;&lt;html&gt;&lt;br /&gt;&lt;head&gt;&lt;br /&gt;&lt;title&gt;upload_cs&lt;/title&gt;&lt;br /&gt;&lt;/head&gt;&lt;br /&gt;&lt;script language=&quot;C#&quot; runat=&quot;server&quot;&gt;&lt;br /&gt;public void UploadFile(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;if (loFile.PostedFile != null)&lt;br /&gt;{&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;string strFileName, strFileNamePath, strFileFolder;&lt;br /&gt;strFileFolder = Context.Server.MapPath(@&quot;data\&quot;);&lt;br /&gt;strFileName = loFile.PostedFile.FileName;&lt;br /&gt;strFileName = Path.GetFileName(strFileName);&lt;br /&gt;strFileNamePath = strFileFolder + strFileName;&lt;br /&gt;loFile.PostedFile.SaveAs(strFileNamePath);&lt;br /&gt;lblFileName.Text = strFileName;&lt;br /&gt;lblFileLength.Text = loFile.PostedFile.ContentLength.ToString();&lt;br /&gt;lblFileType.Text = loFile.PostedFile.ContentType;&lt;br /&gt;pnStatus.Visible = true;&lt;br /&gt;}&lt;br /&gt;catch (Exception x)&lt;br /&gt;{&lt;br /&gt;Label lblError = new Label();&lt;br /&gt;lblError.ForeColor = Color.Red;&lt;br /&gt;lblError.Text = &quot;Exception occurred: &quot; + x.Message;&lt;br /&gt;lblError.Visible = true;&lt;br /&gt;this.Controls.Add(lblError);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;} &lt;br /&gt;&lt;/script&gt;&lt;br /&gt;&lt;body&gt;&lt;br /&gt;&lt;form id=&quot;upload_cs&quot; method=&quot;post&quot; runat=&quot;server&quot; enctype=&quot;multipart/form-data&quot;&gt;&lt;br /&gt;&lt;P&gt;&lt;br /&gt;&lt;INPUT type=&quot;file&quot; id=&quot;loFile&quot; runat=&quot;server&quot;&gt;&lt;br /&gt;&lt;/P&gt;&lt;br /&gt;&lt;P&gt;&lt;br /&gt;&lt;asp:Button id=&quot;btnUpload&quot; runat=&quot;server&quot; Text=&quot; Upload &quot; OnClick=&quot;UploadFile&quot;&gt;&lt;/asp:Button&gt;&lt;/P&gt;&lt;br /&gt;&lt;P&gt;&lt;br /&gt;&lt;asp:Panel id=&quot;pnStatus&quot; runat=&quot;server&quot; Visible=&quot;False&quot;&gt;&lt;br /&gt;&lt;asp:Label id=&quot;lblFileName&quot; Font-Bold=&quot;True&quot; Runat=&quot;server&quot;&gt;&lt;/asp:Label&gt; uploaded&lt;BR&gt;&lt;br /&gt;&lt;asp:Label id=&quot;lblFileLength&quot; Runat=&quot;server&quot;&gt;&lt;/asp:Label&gt; bytes&lt;BR&gt;&lt;br /&gt;&lt;asp:Label id=&quot;lblFileType&quot; Runat=&quot;server&quot;&gt;&lt;/asp:Label&gt;&lt;br /&gt;&lt;/asp:Panel&gt;&lt;/P&gt;&lt;br /&gt;&lt;/form&gt;&lt;br /&gt;&lt;/body&gt;&lt;br /&gt;&lt;/html&gt; &lt;br /&gt;221.	How do I send an email message from my ASP.NET page?&lt;br /&gt;A: You can use the System.Web.Mail.MailMessage and the System.Web.Mail.SmtpMail class to send email in your ASPX pages. Below is a simple example of using this class to send mail in C# and VB.NET. In order to send mail through our mail server, you would want to make sure to set the static SmtpServer property of the SmtpMail class to mail-fwd. &lt;br /&gt;C#&lt;br /&gt;&lt;%@ Import Namespace=&quot;System&quot; %&gt;&lt;br /&gt;&lt;%@ Import Namespace=&quot;System.Web&quot; %&gt;&lt;br /&gt;&lt;%@ Import Namespace=&quot;System.Web.Mail&quot; %&gt;&lt;br /&gt;&lt;HTML&gt;&lt;br /&gt;&lt;HEAD&gt;&lt;br /&gt;&lt;title&gt;Mail Test&lt;/title&gt;&lt;br /&gt;&lt;/HEAD&gt;&lt;br /&gt;&lt;script language=&quot;C#&quot; runat=&quot;server&quot;&gt;&lt;br /&gt;private void Page_Load(Object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;MailMessage mailObj = new MailMessage();&lt;br /&gt;mailObj.From = &quot;sales@joeswidgets.com&quot;;&lt;br /&gt;mailObj.To = &quot;ringleader@forexample-domain.com&quot;;&lt;br /&gt;mailObj.Subject = &quot;Your Widget Order&quot;;&lt;br /&gt;mailObj.Body = &quot;Your order was processed.&quot;;&lt;br /&gt;mailObj.BodyFormat = MailFormat.Text;&lt;br /&gt;SmtpMail.SmtpServer = &quot;mail-fwd&quot;;&lt;br /&gt;SmtpMail.Send(mailObj);&lt;br /&gt;Response.Write(&quot;Mail sent successfully&quot;);&lt;br /&gt;}&lt;br /&gt;catch (Exception x)&lt;br /&gt;{&lt;br /&gt;Response.Write(&quot;Your message was not sent: &quot; + x.Message);&lt;br /&gt;}&lt;br /&gt;} &lt;br /&gt;&lt;/script&gt;&lt;br /&gt;&lt;body&gt;&lt;br /&gt;&lt;form id=&quot;mail_test&quot; method=&quot;post&quot; runat=&quot;server&quot;&gt;&lt;br /&gt;&lt;/form&gt;&lt;br /&gt;&lt;/body&gt;&lt;br /&gt;&lt;/HTML&gt; &lt;br /&gt;222.	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. (Hint use event delegates) Practical Example of Passing an Events to delegates &lt;br /&gt;223.	How can you read 3rd line from a text file?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Transact-SQL Optimization Tips &lt;br /&gt;•	Use views and stored procedures instead of heavy-duty queries.&lt;br /&gt;This can reduce network traffic, because your client will send to server only stored procedure or view name (perhaps with some parameters) instead of large heavy-duty queries text. This can be used to facilitate permission management also, because you can restrict user access to table columns they should not see. &lt;br /&gt;•	Try to use constraints instead of triggers, whenever possible.&lt;br /&gt;Constraints are much more efficient than triggers and can boost performance. So, you should use constraints instead of triggers, whenever possible. &lt;br /&gt;•	Use table variables instead of temporary tables.&lt;br /&gt;Table variables require less locking and logging resources than temporary tables, so table variables should be used whenever possible. The table variables are available in SQL Server 2000 only. &lt;br /&gt;•	Try to use UNION ALL statement instead of UNION, whenever possible.&lt;br /&gt;The UNION ALL statement is much faster than UNION, because UNION ALL statement does not look for duplicate rows, and UNION statement does look for duplicate rows, whether or not they exist. &lt;br /&gt;•	Try to avoid using the DISTINCT clause, whenever possible.&lt;br /&gt;Because using the DISTINCT clause will result in some performance degradation, you should use this clause only when it is necessary. &lt;br /&gt;•	Try to avoid using SQL Server cursors, whenever possible.&lt;br /&gt;SQL Server cursors can result in some performance degradation in comparison with select statements. Try to use correlated sub-query or derived tables, if you need to perform row-by-row operations. &lt;br /&gt;•	Try to avoid the HAVING clause, whenever possible.&lt;br /&gt;The HAVING clause is used to restrict the result set returned by the GROUP BY clause. When you use GROUP BY with the HAVING clause, the GROUP BY clause divides the rows into sets of grouped rows and aggregates their values, and then the HAVING clause eliminates undesired aggregated groups. In many cases, you can write your select statement so, that it will contain only WHERE and GROUP BY clauses without HAVING clause. This can improve the performance of your query. &lt;br /&gt;•	If you need to return the total table&#39;s row count, you can use alternative way instead of SELECT COUNT(*) statement.&lt;br /&gt;Because SELECT COUNT(*) statement make a full table scan to return the total table&#39;s row count, it can take very many time for the large table. There is another way to determine the total row count in a table. You can use sysindexes system table, in this case. There is ROWS column in the sysindexes table. This column contains the total row count for each table in your database. So, you can use the following select statement instead of SELECT COUNT(*): SELECT rows FROM sysindexes WHERE id = OBJECT_ID(&#39;table_name&#39;) AND indid &lt; 2 So, you can improve the speed of such queries in several times. &lt;br /&gt;•	Include SET NOCOUNT ON statement into your stored procedures to stop the message indicating the number of rows affected by a T-SQL statement.&lt;br /&gt;This can reduce network traffic, because your client will not receive the message indicating the number of rows affected by a T-SQL statement. &lt;br /&gt;•	Try to restrict the queries result set by using the WHERE clause.&lt;br /&gt;This can results in good performance benefits, because SQL Server will return to client only particular rows, not all rows from the table(s). This can reduce network traffic and boost the overall performance of the query. &lt;br /&gt;•	Use the select statements with TOP keyword or the SET ROWCOUNT statement, if you need to return only the first n rows.&lt;br /&gt;This can improve performance of your queries, because the smaller result set will be returned. This can also reduce the traffic between the server and the clients. &lt;br /&gt;•	Try to restrict the queries result set by returning only the particular columns from the table, not all table&#39;s columns.&lt;br /&gt;This can results in good performance benefits, because SQL Server will return to client only particular columns, not all table&#39;s columns. This can reduce network traffic and boost the overall performance of the query. &lt;br /&gt;1.Indexes&lt;br /&gt;2.avoid more number of triggers on the table&lt;br /&gt;3.unnecessary complicated joins&lt;br /&gt;4.correct use of Group by clause with the select list&lt;br /&gt;5.in worst cases Denormalization&lt;br /&gt;&lt;br /&gt;Index Optimization tips &lt;br /&gt;•	Every index increases the time in takes to perform INSERTS, UPDATES and DELETES, so the number of indexes should not be very much. Try to use maximum 4-5 indexes on one table, not more. If you have read-only table, then the number of indexes may be increased. &lt;br /&gt;•	Keep your indexes as narrow as possible. This reduces the size of the index and reduces the number of reads required to read the index. &lt;br /&gt;•	Try to create indexes on columns that have integer values rather than character values. &lt;br /&gt;•	If you create a composite (multi-column) index, the order of the columns in the key are very important. Try to order the columns in the key as to enhance selectivity, with the most selective columns to the leftmost of the key. &lt;br /&gt;•	If you want to join several tables, try to create surrogate integer keys for this purpose and create indexes on their columns. &lt;br /&gt;•	Create surrogate integer primary key (identity for example) if your table will not have many insert operations. &lt;br /&gt;•	Clustered indexes are more preferable than nonclustered, if you need to select by a range of values or you need to sort results set with GROUP BY or ORDER BY. &lt;br /&gt;•	If your application will be performing the same query over and over on the same table, consider creating a covering index on the table. &lt;br /&gt;•	You can use the SQL Server Profiler Create Trace Wizard with &quot;Identify Scans of Large Tables&quot; trace to determine which tables in your database may need indexes. This trace will show which tables are being scanned by queries instead of using an index. &lt;br /&gt;•	You can use sp_MSforeachtable undocumented stored procedure to rebuild all indexes in your database. Try to schedule it to execute during CPU idle time and slow production periods.&lt;br /&gt;sp_MSforeachtable @command1=&quot;print &#39;?&#39; DBCC DBREINDEX (&#39;?&#39;)&quot; &lt;br /&gt;T-SQL Queries &lt;br /&gt;1.	2 tables &lt;br /&gt;Employee	Phone&lt;br /&gt;empid&lt;br /&gt;empname&lt;br /&gt;salary&lt;br /&gt;mgrid	empid&lt;br /&gt;phnumber&lt;br /&gt;2.	Select all employees who doesn&#39;t have phone?&lt;br /&gt;SELECT empname&lt;br /&gt;FROM Employee&lt;br /&gt;WHERE (empid NOT IN&lt;br /&gt;(SELECT DISTINCT empid&lt;br /&gt;FROM phone))&lt;br /&gt;3.	Select the employee names who is having more than one phone numbers.&lt;br /&gt;SELECT empname&lt;br /&gt;FROM employee&lt;br /&gt;WHERE (empid IN&lt;br /&gt;(SELECT empid&lt;br /&gt;FROM phone&lt;br /&gt;GROUP BY empid&lt;br /&gt;HAVING COUNT(empid) &gt; 1)) &lt;br /&gt;4.	Select the details of 3 max salaried employees from employee table.&lt;br /&gt;SELECT TOP 3 empid, salary&lt;br /&gt;FROM employee&lt;br /&gt;ORDER BY salary DESC &lt;br /&gt;5.	Display all managers from the table. (manager id is same as emp id)&lt;br /&gt;SELECT empname&lt;br /&gt;FROM employee&lt;br /&gt;WHERE (empid IN&lt;br /&gt;(SELECT DISTINCT mgrid&lt;br /&gt;FROM employee)) &lt;br /&gt;6.	Write a Select statement to list the Employee Name, Manager Name under a particular manager?&lt;br /&gt;SELECT e1.empname AS EmpName, e2.empname AS ManagerName&lt;br /&gt;FROM Employee e1 INNER JOIN&lt;br /&gt;Employee e2 ON e1.mgrid = e2.empid&lt;br /&gt;ORDER BY e2.mgrid &lt;br /&gt;7.	2 tables emp and phone.&lt;br /&gt;emp fields are - empid, name&lt;br /&gt;Ph fields are - empid, ph (office, mobile, home). Select all employees who doesn&#39;t have any ph nos.&lt;br /&gt;SELECT *&lt;br /&gt;FROM employee LEFT OUTER JOIN&lt;br /&gt;phone ON employee.empid = phone.empid&lt;br /&gt;WHERE (phone.office IS NULL OR phone.office = &#39; &#39;)&lt;br /&gt;AND (phone.mobile IS NULL OR phone.mobile = &#39; &#39;)&lt;br /&gt;AND (phone.home IS NULL OR phone.home = &#39; &#39;) &lt;br /&gt;8.	Find employee who is living in more than one city. &lt;br /&gt;Two Tables: &lt;br /&gt;Emp	City&lt;br /&gt;Empid&lt;br /&gt;empName&lt;br /&gt;Salary	Empid&lt;br /&gt;City&lt;br /&gt;9.	SELECT empname, fname, lname&lt;br /&gt;FROM employee&lt;br /&gt;WHERE (empid IN&lt;br /&gt;(SELECT empid&lt;br /&gt;FROM city&lt;br /&gt;GROUP BY empid&lt;br /&gt;HAVING COUNT(empid) &gt; 1)) &lt;br /&gt;10.	Find all employees who is living in the same city. (table is same as above)&lt;br /&gt;SELECT fname&lt;br /&gt;FROM employee&lt;br /&gt;WHERE (empid IN&lt;br /&gt;(SELECT empid&lt;br /&gt;FROM city a&lt;br /&gt;WHERE city IN&lt;br /&gt;(SELECT city&lt;br /&gt;FROM city b&lt;br /&gt;GROUP BY city&lt;br /&gt;HAVING COUNT(city) &gt; 1))) &lt;br /&gt;11.	There is a table named MovieTable with three columns - moviename, person and role. Write a query which gets the movie details where Mr. Amitabh and Mr. Vinod acted and their role is actor.&lt;br /&gt;SELECT DISTINCT m1.moviename&lt;br /&gt;FROM MovieTable m1 INNER JOIN&lt;br /&gt;MovieTable m2 ON m1.moviename = m2.moviename&lt;br /&gt;WHERE (m1.person = &#39;amitabh&#39; AND m2.person = &#39;vinod&#39; OR&lt;br /&gt;m2.person = &#39;amitabh&#39; AND m1.person = &#39;vinod&#39;) AND (m1.role = &#39;actor&#39;) AND (m2.role = &#39;actor&#39;)&lt;br /&gt;ORDER BY m1.moviename &lt;br /&gt;12.	There are two employee tables named emp1 and emp2. Both contains same structure (salary details). But Emp2 salary details are incorrect and emp1 salary details are correct. So, write a query which corrects salary details of the table emp2&lt;br /&gt;update a set a.sal=b.sal from emp1 a, emp2 b where a.empid=b.empid &lt;br /&gt;13.	Given a Table named “Students” which contains studentid, subjectid and marks. Where there are 10 subjects and 50 students. Write a Query to find out the Maximum marks obtained in each subject. &lt;br /&gt;14.	In this same tables now write a SQL Query to get the studentid also to combine with previous results. &lt;br /&gt;15.	Three tables – student , course, marks – how do go at finding name of the students who got max marks in the diff courses.&lt;br /&gt;SELECT student.name, course.name AS coursename, marks.sid, marks.mark&lt;br /&gt;FROM marks INNER JOIN&lt;br /&gt;student ON marks.sid = student.sid INNER JOIN&lt;br /&gt;course ON marks.cid = course.cid&lt;br /&gt;WHERE (marks.mark =&lt;br /&gt;(SELECT MAX(Mark)&lt;br /&gt;FROM Marks MaxMark&lt;br /&gt;WHERE MaxMark.cID = Marks.cID)) &lt;br /&gt;16.	There is a table day_temp which has three columns dayid, day and temperature. How do I write a query to get the difference of temperature among each other for seven days of a week?&lt;br /&gt;SELECT a.dayid, a.dday, a.tempe, a.tempe - b.tempe AS Difference&lt;br /&gt;FROM day_temp a INNER JOIN&lt;br /&gt;day_temp b ON a.dayid = b.dayid + 1&lt;br /&gt;OR&lt;br /&gt;Select a.day, a.degree-b.degree from temperature a, temperature b where a.id=b.id+1 &lt;br /&gt;17.	There is a table which contains the names like this. a1, a2, a3, a3, a4, a1, a1, a2 and their salaries. Write a query to get grand total salary, and total salaries of individual employees in one query.&lt;br /&gt;SELECT empid, SUM(salary) AS salary&lt;br /&gt;FROM employee&lt;br /&gt;GROUP BY empid WITH ROLLUP&lt;br /&gt;ORDER BY empid &lt;br /&gt;18.	How to know how many tables contains empno as a column in a database?&lt;br /&gt;SELECT COUNT(*) AS Counter&lt;br /&gt;FROM syscolumns&lt;br /&gt;WHERE (name = &#39;empno&#39;) &lt;br /&gt;19.	Find duplicate rows in a table? OR I have a table with one column which has many records which are not distinct. I need to find the distinct values from that column and number of times it’s repeated.&lt;br /&gt;SELECT sid, mark, COUNT(*) AS Counter&lt;br /&gt;FROM marks&lt;br /&gt;GROUP BY sid, mark&lt;br /&gt;HAVING (COUNT(*) &gt; 1) &lt;br /&gt;20.	How to delete the rows which are duplicate (don’t delete both duplicate records).&lt;br /&gt;SET ROWCOUNT 1&lt;br /&gt;DELETE yourtable&lt;br /&gt;FROM yourtable a&lt;br /&gt;WHERE (SELECT COUNT(*) FROM yourtable b WHERE b.name1 = a.name1 AND b.age1 = a.age1) &gt; 1&lt;br /&gt;WHILE @@rowcount &gt; 0&lt;br /&gt;  DELETE yourtable&lt;br /&gt;  FROM yourtable a&lt;br /&gt;  WHERE (SELECT COUNT(*) FROM yourtable b WHERE b.name1 = a.name1 AND b.age1 = a.age1) &gt; 1&lt;br /&gt;SET ROWCOUNT 0 &lt;br /&gt;21.	How to find 6th highest salary&lt;br /&gt;SELECT TOP 1 salary&lt;br /&gt;FROM (SELECT DISTINCT TOP 6 salary&lt;br /&gt;FROM employee&lt;br /&gt;ORDER BY salary DESC) a&lt;br /&gt;ORDER BY salary &lt;br /&gt;22.	Find top salary among two tables&lt;br /&gt;SELECT TOP 1 sal&lt;br /&gt;FROM (SELECT MAX(sal) AS sal&lt;br /&gt;FROM sal1&lt;br /&gt;UNION&lt;br /&gt;SELECT MAX(sal) AS sal&lt;br /&gt;FROM sal2) a&lt;br /&gt;ORDER BY sal DESC &lt;br /&gt;23.	Write a query to convert all the letters in a word to upper case&lt;br /&gt;SELECT UPPER(&#39;test&#39;) &lt;br /&gt;24.	Write a query to round up the values of a number. For example even if the user enters 7.1 it should be rounded up to 8.&lt;br /&gt;SELECT CEILING (7.1) &lt;br /&gt;25.	Write a SQL Query to find first day of month?&lt;br /&gt;SELECT DATENAME(dw, DATEADD(dd, - DATEPART(dd, GETDATE()) + 1, GETDATE())) AS FirstDay &lt;br /&gt;Datepart	Abbreviations&lt;br /&gt;Year	yy, yyyy&lt;br /&gt;Quarter	qq, q&lt;br /&gt;Month	mm, m&lt;br /&gt;dayofyear	dy, y&lt;br /&gt;Day	dd, d&lt;br /&gt;Week	wk, ww&lt;br /&gt;weekday	dw&lt;br /&gt;Hour	hh&lt;br /&gt;minute	mi, n&lt;br /&gt;second	ss, s&lt;br /&gt;millisecond	ms&lt;br /&gt;26.	Table A contains column1 which is primary key and has 2 values (1, 2) and Table B contains column1 which is primary key and has 2 values (2, 3). Write a query which returns the values that are not common for the tables and the query should return one column with 2 records.&lt;br /&gt;SELECT tbla.a&lt;br /&gt;FROM tbla, tblb&lt;br /&gt;WHERE tbla.a &lt;&gt;&lt;br /&gt;(SELECT tblb.a&lt;br /&gt;FROM tbla, tblb&lt;br /&gt;WHERE tbla.a = tblb.a)&lt;br /&gt;UNION&lt;br /&gt;SELECT tblb.a&lt;br /&gt;FROM tbla, tblb&lt;br /&gt;WHERE tblb.a &lt;&gt;&lt;br /&gt;(SELECT tbla.a&lt;br /&gt;FROM tbla, tblb&lt;br /&gt;WHERE tbla.a = tblb.a)&lt;br /&gt;&lt;br /&gt;OR (better approach)&lt;br /&gt;&lt;br /&gt;SELECT a&lt;br /&gt;FROM tbla&lt;br /&gt;WHERE a NOT IN&lt;br /&gt;(SELECT a&lt;br /&gt;FROM tblb)&lt;br /&gt;UNION ALL&lt;br /&gt;SELECT a&lt;br /&gt;FROM tblb&lt;br /&gt;WHERE a NOT IN&lt;br /&gt;(SELECT a&lt;br /&gt;FROM tbla) &lt;br /&gt;27.	There are 3 tables Titles, Authors and Title-Authors (check PUBS db). Write the query to get the author name and the number of books written by that author, the result should start from the author who has written the maximum number of books and end with the author who has written the minimum number of books.&lt;br /&gt;SELECT authors.au_lname, COUNT(*) AS BooksCount&lt;br /&gt;FROM authors INNER JOIN&lt;br /&gt;titleauthor ON authors.au_id = titleauthor.au_id INNER JOIN&lt;br /&gt;titles ON titles.title_id = titleauthor.title_id&lt;br /&gt;GROUP BY authors.au_lname&lt;br /&gt;ORDER BY BooksCount DESC &lt;br /&gt;28.	&lt;br /&gt;UPDATE emp_master&lt;br /&gt;SET emp_sal = &lt;br /&gt;CASE&lt;br /&gt;WHEN emp_sal &gt; 0 AND emp_sal &lt;= 20000 THEN (emp_sal * 1.01) &lt;br /&gt;WHEN emp_sal &gt; 20000 THEN (emp_sal * 1.02) &lt;br /&gt;END &lt;br /&gt;29.	List all products with total quantity ordered, if quantity ordered is null show it as 0.&lt;br /&gt;SELECT name, CASE WHEN SUM(qty) IS NULL THEN 0 WHEN SUM(qty) &gt; 0 THEN SUM(qty) END AS tot&lt;br /&gt;FROM [order] RIGHT OUTER JOIN&lt;br /&gt;product ON [order].prodid = product.prodid&lt;br /&gt;GROUP BY name&lt;br /&gt;Result:&lt;br /&gt;coke 60&lt;br /&gt;mirinda 0&lt;br /&gt;pepsi 10 &lt;br /&gt;30.	ANY, SOME, or ALL?&lt;br /&gt;ALL means greater than every value--in other words, greater than the maximum value. For example, &gt;ALL (1, 2, 3) means greater than 3.&lt;br /&gt;ANY means greater than at least one value, that is, greater than the minimum. So &gt;ANY (1, 2, 3) means greater than 1. SOME is an SQL-92 standard equivalent for ANY. &lt;br /&gt;31.	IN &amp; = (difference in correlated sub query)&lt;br /&gt;&lt;br /&gt;INDEX &lt;br /&gt;32.	What is Index? It’s purpose?&lt;br /&gt;Indexes in databases are similar to indexes in books. In a database, an index allows the database program to find data in a table without scanning the entire table. An index in a database is a list of values in a table with the storage locations of rows in the table that contain each value. Indexes can be created on either a single column or a combination of columns in a table and are implemented in the form of B-trees. An index contains an entry with one or more columns (the search key) from each row in a table. A B-tree is sorted on the search key, and can be searched efficiently on any leading subset of the search key. For example, an index on columns A, B, C can be searched efficiently on A, on A, B, and A, B, C. &lt;br /&gt;33.	Explain about Clustered and non clustered index? How to choose between a Clustered Index and a Non-Clustered Index?&lt;br /&gt;There are clustered and nonclustered indexes. A clustered index is a special type of index that reorders the way records in the table are physically stored. Therefore table can have only one clustered index. The leaf nodes of a clustered index contain the data pages. &lt;br /&gt;A nonclustered index is a special type of index in which the logical order of the index does not match the physical stored order of the rows on disk. The leaf nodes of a nonclustered index does not consist of the data pages. Instead, the leaf nodes contain index rows.&lt;br /&gt;Consider using a clustered index for: &lt;br /&gt;o	Columns that contain a large number of distinct values. &lt;br /&gt;o	Queries that return a range of values using operators such as BETWEEN, &gt;, &gt;=, &lt;, and &lt;=. &lt;br /&gt;o	Columns that are accessed sequentially. &lt;br /&gt;o	Queries that return large result sets.&lt;br /&gt;Non-clustered indexes have the same B-tree structure as clustered indexes, with two significant differences: &lt;br /&gt;o	The data rows are not sorted and stored in order based on their non-clustered keys. &lt;br /&gt;o	The leaf layer of a non-clustered index does not consist of the data pages. Instead, the leaf nodes contain index rows. Each index row contains the non-clustered key value and one or more row locators that point to the data row (or rows if the index is not unique) having the key value. &lt;br /&gt;o	Per table only 249 non clustered indexes. &lt;br /&gt;34.	Disadvantage of index?&lt;br /&gt;Every index increases the time in takes to perform INSERTS, UPDATES and DELETES, so the number of indexes should not be very much. &lt;br /&gt;35.	Given a scenario that I have a 10 Clustered Index in a Table to all their 10 Columns. What are the advantages and disadvantages?&lt;br /&gt;A: Only 1 clustered index is possible. &lt;br /&gt;36.	How can I enforce to use particular index?&lt;br /&gt;You can use index hint (index=&lt;index_name&gt;) after the table name.&lt;br /&gt;SELECT au_lname FROM authors (index=aunmind) &lt;br /&gt;37.	What is Index Tuning?&lt;br /&gt;One of the hardest tasks facing database administrators is the selection of appropriate columns for non-clustered indexes. You should consider creating non-clustered indexes on any columns that are frequently referenced in the WHERE clauses of SQL statements. Other good candidates are columns referenced by JOIN and GROUP BY operations.&lt;br /&gt;You may wish to also consider creating non-clustered indexes that cover all of the columns used by certain frequently issued queries. These queries are referred to as “covered queries” and experience excellent performance gains.&lt;br /&gt;Index Tuning is the process of finding appropriate column for non-clustered indexes.&lt;br /&gt;SQL Server provides a wonderful facility known as the Index Tuning Wizard which greatly enhances the index selection process. &lt;br /&gt;38.	Difference between Index defrag and Index rebuild?&lt;br /&gt;When you create an index in the database, the index information used by queries is stored in index pages. The sequential index pages are chained together by pointers from one page to the next. When changes are made to the data that affect the index, the information in the index can become scattered in the database. Rebuilding an index reorganizes the storage of the index data (and table data in the case of a clustered index) to remove fragmentation. This can improve disk performance by reducing the number of page reads required to obtain the requested data&lt;br /&gt;DBCC INDEXDEFRAG - Defragments clustered and secondary indexes of the specified table or view.&lt;br /&gt;** &lt;br /&gt;39.	What is sorting and what is the difference between sorting &amp; clustered indexes?&lt;br /&gt;The ORDER BY clause sorts query results by one or more columns up to 8,060 bytes. This will happen by the time when we retrieve data from database. Clustered indexes physically sorting data, while inserting/updating the table. &lt;br /&gt;40.	What are statistics, under what circumstances they go out of date, how do you update them?&lt;br /&gt;Statistics determine the selectivity of the indexes. If an indexed column has unique values then the selectivity of that index is more, as opposed to an index with non-unique values. Query optimizer uses these indexes in determining whether to choose an index or not while executing a query.&lt;br /&gt;Some situations under which you should update statistics:&lt;br /&gt;1) If there is significant change in the key values in the index&lt;br /&gt;2) If a large amount of data in an indexed column has been added, changed, or removed (that is, if the distribution of key values has changed), or the table has been truncated using the TRUNCATE TABLE statement and then repopulated&lt;br /&gt;3) Database is upgraded from a previous version &lt;br /&gt;41.	What is fillfactor? What is the use of it ? What happens when we ignore it? When you should use low fill factor?&lt;br /&gt;When you create a clustered index, the data in the table is stored in the data pages of the database according to the order of the values in the indexed columns. When new rows of data are inserted into the table or the values in the indexed columns are changed, Microsoft® SQL Server™ 2000 may have to reorganize the storage of the data in the table to make room for the new row and maintain the ordered storage of the data. This also applies to nonclustered indexes. When data is added or changed, SQL Server may have to reorganize the storage of the data in the nonclustered index pages. When a new row is added to a full index page, SQL Server moves approximately half the rows to a new page to make room for the new row. This reorganization is known as a page split. Page splitting can impair performance and fragment the storage of the data in a table.&lt;br /&gt;When creating an index, you can specify a fill factor to leave extra gaps and reserve a percentage of free space on each leaf level page of the index to accommodate future expansion in the storage of the table&#39;s data and reduce the potential for page splits. The fill factor value is a percentage from 0 to 100 that specifies how much to fill the data pages after the index is created. A value of 100 means the pages will be full and will take the least amount of storage space. This setting should be used only when there will be no changes to the data, for example, on a read-only table. A lower value leaves more empty space on the data pages, which reduces the need to split data pages as indexes grow but requires more storage space. This setting is more appropriate when there will be changes to the data in the table.&lt;br /&gt;&lt;br /&gt;DATA TYPES &lt;br /&gt;42.	What are the data types in SQL &lt;br /&gt;bigint	Binary	bit	char	cursor&lt;br /&gt;datetime	Decimal	float	image	int&lt;br /&gt;money	Nchar	ntext	nvarchar	real&lt;br /&gt;smalldatetime	Smallint	smallmoney	text	timestamp&lt;br /&gt;tinyint	Varbinary	Varchar	uniqueidentifier	 &lt;br /&gt;43.	Difference between char and nvarchar / char and varchar data-type?&lt;br /&gt;char[(n)] - Fixed-length non-Unicode character data with length of n bytes. n must be a value from 1 through 8,000. Storage size is n bytes. The SQL-92 synonym for char is character.&lt;br /&gt;nvarchar(n) - Variable-length Unicode character data of n characters. n must be a value from 1 through 4,000. Storage size, in bytes, is two times the number of characters entered. The data entered can be 0 characters in length. The SQL-92 synonyms for nvarchar are national char varying and national character varying. &lt;br /&gt;varchar[(n)] - Variable-length non-Unicode character data with length of n bytes. n must be a value from 1 through 8,000. Storage size is the actual length in bytes of the data entered, not n bytes. The data entered can be 0 characters in length. The SQL-92 synonyms for varchar are char varying or character varying. &lt;br /&gt;44.	GUID datasize?&lt;br /&gt;128bit &lt;br /&gt;45.	How GUID becoming unique across machines?&lt;br /&gt;To ensure uniqueness across machines, the ID of the network card is used (among others) to compute the number. &lt;br /&gt;46.	What is the difference between text and image data type?&lt;br /&gt;Text and image. Use text for character data if you need to store more than 255 characters in SQL Server 6.5, or more than 8000 in SQL Server 7.0. Use image for binary large objects (BLOBs) such as digital images. With text and image data types, the data is not stored in the row, so the limit of the page size does not apply.All that is stored in the row is a pointer to the database pages that contain the data.Individual text, ntext, and image values can be a maximum of 2-GB, which is too long to store in a single data row.&lt;br /&gt;&lt;br /&gt;JOINS &lt;br /&gt;47.	What are joins?&lt;br /&gt;Sometimes we have to select data from two or more tables to make our result complete. We have to perform a join. &lt;br /&gt;48.	How many types of Joins?&lt;br /&gt;Joins can be categorized as: &lt;br /&gt;•	Inner joins (the typical join operation, which uses some comparison operator like = or &lt;&gt;). These include equi-joins and natural joins. &lt;br /&gt;Inner joins use a comparison operator to match rows from two tables based on the values in common columns from each table. For example, retrieving all rows where the student identification number is the same in both the students and courses tables. &lt;br /&gt;•	Outer joins. Outer joins can be a left, a right, or full outer join. &lt;br /&gt;Outer joins are specified with one of the following sets of keywords when they are specified in the FROM clause: &lt;br /&gt;•	LEFT JOIN or LEFT OUTER JOIN -The result set of a left outer join includes all the rows from the left table specified in the LEFT OUTER clause, not just the ones in which the joined columns match. When a row in the left table has no matching rows in the right table, the associated result set row contains null values for all select list columns coming from the right table. &lt;br /&gt;•	RIGHT JOIN or RIGHT OUTER JOIN - A right outer join is the reverse of a left outer join. All rows from the right table are returned. Null values are returned for the left table any time a right table row has no matching row in the left table. &lt;br /&gt;•	FULL JOIN or FULL OUTER JOIN - A full outer join returns all rows in both the left and right tables. Any time a row has no match in the other table, the select list columns from the other table contain null values. When there is a match between the tables, the entire result set row contains data values from the base tables. &lt;br /&gt;•	Cross joins - Cross joins return all rows from the left table, each row from the left table is combined with all rows from the right table. Cross joins are also called Cartesian products. (A Cartesian join will get you a Cartesian product. A Cartesian join is when you join every row of one table to every row of another table. You can also get one by joining every row of a table to every row of itself.) &lt;br /&gt;49.	What is self join?&lt;br /&gt;A table can be joined to itself in a self-join. &lt;br /&gt;50.	What are the differences between UNION and JOINS?&lt;br /&gt;A join selects columns from 2 or more tables. A union selects rows. &lt;br /&gt;51.	Can I improve performance by using the ANSI-style joins instead of the old-style joins?&lt;br /&gt;Code Example 1:&lt;br /&gt;select o.name, i.name&lt;br /&gt;from sysobjects o, sysindexes i&lt;br /&gt;where o.id = i.id&lt;br /&gt;Code Example 2:&lt;br /&gt;select o.name, i.name&lt;br /&gt;from sysobjects o inner join sysindexes i&lt;br /&gt;on o.id = i.id&lt;br /&gt;You will not get any performance gain by switching to the ANSI-style JOIN syntax.&lt;br /&gt;Using the ANSI-JOIN syntax gives you an important advantage: Because the join logic is cleanly separated from the filtering criteria, you can understand the query logic more quickly.&lt;br /&gt;The SQL Server old-style JOIN executes the filtering conditions before executing the joins, whereas the ANSI-style JOIN reverses this procedure (join logic precedes filtering).&lt;br /&gt;Perhaps the most compelling argument for switching to the ANSI-style JOIN is that Microsoft has explicitly stated that SQL Server will not support the old-style OUTER JOIN syntax indefinitely. Another important consideration is that the ANSI-style JOIN supports query constructions that the old-style JOIN syntax does not support. &lt;br /&gt;52.	What is derived table?&lt;br /&gt;Derived tables are SELECT statements in the FROM clause referred to by an alias or a user-specified name. The result set of the SELECT in the FROM clause forms a table used by the outer SELECT statement. For example, this SELECT uses a derived table to find if any store carries all book titles in the pubs database: &lt;br /&gt;SELECT ST.stor_id, ST.stor_name&lt;br /&gt;FROM stores AS ST,&lt;br /&gt;     (SELECT stor_id, COUNT(DISTINCT title_id) AS title_count&lt;br /&gt;      FROM sales&lt;br /&gt;      GROUP BY stor_id&lt;br /&gt;     ) AS SA&lt;br /&gt;WHERE ST.stor_id = SA.stor_id&lt;br /&gt;AND SA.title_count = (SELECT COUNT(*) FROM titles)&lt;br /&gt;&lt;br /&gt;STORED PROCEDURE &lt;br /&gt;53.	What is Stored procedure?&lt;br /&gt;A stored procedure is a set of Structured Query Language (SQL) statements that you assign a name to and store in a database in compiled form so that you can share it between a number of programs. &lt;br /&gt;•	They allow modular programming. &lt;br /&gt;•	They allow faster execution. &lt;br /&gt;•	They can reduce network traffic. &lt;br /&gt;•	They can be used as a security mechanism. &lt;br /&gt;54.	What are the different types of Storage Procedure? &lt;br /&gt; .	Temporary Stored Procedures - SQL Server supports two types of temporary procedures: local and global. A local temporary procedure is visible only to the connection that created it. A global temporary procedure is available to all connections. Local temporary procedures are automatically dropped at the end of the current session. Global temporary procedures are dropped at the end of the last session using the procedure. Usually, this is when the session that created the procedure ends. Temporary procedures named with # and ## can be created by any user. &lt;br /&gt;a.	System stored procedures are created and stored in the master database and have the sp_ prefix.(or xp_) System stored procedures can be executed from any database without having to qualify the stored procedure name fully using the database name master. (If any user-created stored procedure has the same name as a system stored procedure, the user-created stored procedure will never be executed.) &lt;br /&gt;b.	Automatically Executing Stored Procedures - One or more stored procedures can execute automatically when SQL Server starts. The stored procedures must be created by the system administrator and executed under the sysadmin fixed server role as a background process. The procedure(s) cannot have any input parameters. &lt;br /&gt;c.	User stored procedure &lt;br /&gt;55.	How do I mark the stored procedure to automatic execution? &lt;br /&gt;You can use the sp_procoption system stored procedure to mark the stored procedure to automatic execution when the SQL Server will start. Only objects in the master database owned by dbo can have the startup setting changed and this option is restricted to objects that have no parameters.&lt;br /&gt;USE master&lt;br /&gt;EXEC sp_procoption &#39;indRebuild&#39;, &#39;startup&#39;, &#39;true&#39;) &lt;br /&gt;56.	How can you optimize a stored procedure? &lt;br /&gt;57.	How will know whether the SQL statements are executed?&lt;br /&gt;When used in a stored procedure, the RETURN statement can specify an integer value to return to the calling application, batch, or procedure. If no value is specified on RETURN, a stored procedure returns the value 0.  The stored procedures return a value of 0 when no errors were encountered. Any nonzero value indicates an error occurred. &lt;br /&gt;58.	Why one should not prefix user stored procedures with sp_?&lt;br /&gt;It is strongly recommended that you do not create any stored procedures using sp_ as a prefix. SQL Server always looks for a stored procedure beginning with sp_ in this order: &lt;br /&gt;0.	The stored procedure in the master database. &lt;br /&gt;1.	The stored procedure based on any qualifiers provided (database name or owner). &lt;br /&gt;2.	The stored procedure using dbo as the owner, if one is not specified. &lt;br /&gt;Therefore, although the user-created stored procedure prefixed with sp_ may exist in the current database, the master database is always checked first, even if the stored procedure is qualified with the database name. &lt;br /&gt;59.	What can cause a Stored procedure execution plan to become invalidated and/or fall out of cache? &lt;br /&gt;0.	Server restart &lt;br /&gt;1.	Plan is aged out due to low use &lt;br /&gt;2.	DBCC FREEPROCCACHE (sometime desired to force it) &lt;br /&gt;60.	When do one need to recompile stored procedure?&lt;br /&gt;if a new index is added from which the stored procedure might benefit, optimization does not automatically happen (until the next time the stored procedure is run after SQL Server is restarted). &lt;br /&gt;&lt;br /&gt;61.	SQL Server provides three ways to recompile a stored procedure: &lt;br /&gt;•	The sp_recompile system stored procedure forces a recompile of a stored procedure the next time it is run. &lt;br /&gt;•	Creating a stored procedure that specifies the WITH RECOMPILE option in its definition indicates that SQL Server does not cache a plan for this stored procedure; the stored procedure is recompiled each time it is executed. Use the WITH RECOMPILE option when stored procedures take parameters whose values differ widely between executions of the stored procedure, resulting in different execution plans to be created each time. Use of this option is uncommon, and causes the stored procedure to execute more slowly because the stored procedure must be recompiled each time it is executed. &lt;br /&gt;•	You can force the stored procedure to be recompiled by specifying the WITH RECOMPILE option when you execute the stored procedure. Use this option only if the parameter you are supplying is atypical or if the data has significantly changed since the stored procedure was created. &lt;br /&gt;62.	How to find out which stored procedure is recompiling? How to stop stored procedures from recompiling? &lt;br /&gt;63.	I have Two Stored Procedures SP1 and SP2 as given below. How the Transaction works, whether SP2 Transaction succeeds or fails?&lt;br /&gt;CREATE PROCEDURE SP1 AS&lt;br /&gt;BEGIN TRAN&lt;br /&gt;INSERT INTO MARKS (SID,MARK,CID) VALUES (5,6,3)&lt;br /&gt;EXEC SP2&lt;br /&gt;ROLLBACK&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;CREATE PROCEDURE SP2 AS&lt;br /&gt;BEGIN TRAN&lt;br /&gt;INSERT INTO MARKS (SID,MARK,CID) VALUES (100,100,103)&lt;br /&gt;commit tran&lt;br /&gt;GO&lt;br /&gt;Both will get roll backed. &lt;br /&gt;64.	CREATE PROCEDURE SP1 AS&lt;br /&gt;BEGIN TRAN&lt;br /&gt;    INSERT INTO MARKS (SID,MARK,CID) VALUES (5,6,3)&lt;br /&gt;    BEGIN TRAN&lt;br /&gt;        INSERT INTO STUDENT (SID,NAME1) VALUES (1,&#39;SA&#39;)&lt;br /&gt;    commit tran&lt;br /&gt;ROLLBACK TRAN&lt;br /&gt;GO&lt;br /&gt;Both will get roll backed. &lt;br /&gt;65.	How will you handle Errors in Sql Stored Procedure?&lt;br /&gt;INSERT NonFatal VALUES (@Column2)&lt;br /&gt;IF @@ERROR &lt;&gt;0&lt;br /&gt; BEGIN&lt;br /&gt;  PRINT &#39;Error Occured&#39;&lt;br /&gt; END &lt;br /&gt;http://www.sqlteam.com/item.asp?ItemID=2463 &lt;br /&gt;66.	How will you raise an error in sql?&lt;br /&gt;RAISERROR - Returns a user-defined error message and sets a system flag to record that an error has occurred. Using RAISERROR, the client can either retrieve an entry from the sysmessages table or build a message dynamically with user-specified severity and state information. After the message is defined it is sent back to the client as a server error message. &lt;br /&gt;67.	I have a stored procedure like&lt;br /&gt;commit tran&lt;br /&gt;create table a()&lt;br /&gt;insert into table b&lt;br /&gt;--&lt;br /&gt;--&lt;br /&gt;rollback tran&lt;br /&gt;what will be the result? Is table created? data will be inserted in table b? &lt;br /&gt;68.	What do you do when one procedure is blocking the other?&lt;br /&gt;** &lt;br /&gt;69.	How you will return XML from Stored Procedure?&lt;br /&gt;You use the FOR XML clause of the SELECT statement, and within the FOR XML clause you specify an XML mode: RAW, AUTO, or EXPLICIT. &lt;br /&gt;70.	What are the differences between RAW, AUTO and Explicit modes in retrieving data from SQL Server in XML format?&lt;br /&gt;** &lt;br /&gt;71.	Can a Stored Procedure call itself (recursive). If so then up to what level and can it be control?&lt;br /&gt;Stored procedures are nested when one stored procedure calls another. You can nest stored procedures up to 32 levels. The nesting level increases by one when the called stored procedure begins execution and decreases by one when the called stored procedure completes execution. Attempting to exceed the maximum of 32 levels of nesting causes the whole calling stored procedure chain to fail. The current nesting level for the stored procedures in execution is stored in the @@NESTLEVEL function.&lt;br /&gt;eg:&lt;br /&gt;SET NOCOUNT ON&lt;br /&gt;USE master&lt;br /&gt;IF OBJECT_ID(&#39;dbo.sp_calcfactorial&#39;) IS NOT NULL&lt;br /&gt;DROP PROC dbo.sp_calcfactorial&lt;br /&gt;GO&lt;br /&gt;CREATE PROC dbo.sp_calcfactorial&lt;br /&gt;@base_number int, @factorial int OUT&lt;br /&gt;AS&lt;br /&gt;DECLARE @previous_number int&lt;br /&gt;IF (@base_number&lt;2) SET @factorial=1 -- Factorial of 0 or 1=1&lt;br /&gt;ELSE BEGIN&lt;br /&gt;SET @previous_number=@base_number-1&lt;br /&gt;EXEC dbo.sp_calcfactorial @previous_number, @factorial OUT -- Recursive call&lt;br /&gt;IF (@factorial=-1) RETURN(-1) -- Got an error, return&lt;br /&gt;SET @factorial=@factorial*@base_number&lt;br /&gt;END&lt;br /&gt;RETURN(0)&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;calling proc.&lt;br /&gt;DECLARE @factorial int &lt;br /&gt;EXEC dbo.sp_calcfactorial 4, @factorial OUT &lt;br /&gt;SELECT @factorial &lt;br /&gt;72.	Nested Triggers&lt;br /&gt;Triggers are nested when a trigger performs an action that initiates another trigger, which can initiate another trigger, and so on. Triggers can be nested up to 32 levels, and you can control whether triggers can be nested through the nested triggers server configuration option. &lt;br /&gt;73.	What is an extended stored procedure? Can you instantiate a COM object by using T-SQL? &lt;br /&gt;An extended stored procedure is a function within a DLL (written in a programming language like C, C++ using Open Data Services (ODS) API) that can be called from T-SQL, just the way we call normal stored procedures using the EXEC statement. &lt;br /&gt;74.	Difference between view and stored procedure?&lt;br /&gt;Views can have only select statements (create, update, truncate, delete statements are not allowed) Views cannot have “select into”, “Group by” “Having”, ”Order by” &lt;br /&gt;75.	What is a Function &amp; what are the different user defined functions?&lt;br /&gt;Function is a saved Transact-SQL routine that returns a value. User-defined functions cannot be used to perform a set of actions that modify the global database state. User-defined functions, like system functions, can be invoked from a query. They also can be executed through an EXECUTE statement like stored procedures. &lt;br /&gt;0.	Scalar Functions&lt;br /&gt;Functions are scalar-valued if the RETURNS clause specified one of the scalar data types &lt;br /&gt;1.	Inline Table-valued Functions&lt;br /&gt;If the RETURNS clause specifies TABLE with no accompanying column list, the function is an inline function. &lt;br /&gt;2.	Multi-statement Table-valued Functions&lt;br /&gt;If the RETURNS clause specifies a TABLE type with columns and their data types, the function is a multi-statement table-valued function. &lt;br /&gt;76.	What are the difference between a function and a stored procedure?&lt;br /&gt;0.	Functions can be used in a select statement where as procedures cannot &lt;br /&gt;1.	Procedure takes both input and output parameters but Functions takes only input parameters &lt;br /&gt;2.	Functions cannot return values of type text, ntext, image &amp; timestamps where as procedures can &lt;br /&gt;3.	Functions can be used as user defined datatypes in create table but procedures cannot &lt;br /&gt;***Eg:-create table &lt;tablename&gt;(name varchar(10),salary getsal(name))&lt;br /&gt;Here getsal is a user defined function which returns a salary type, when table is created no storage is allotted for salary type, and getsal function is also not executed, But when we are fetching some values from this table, getsal function get’s executed and the return &lt;br /&gt;Type is returned as the result set. &lt;br /&gt;77.	How to debug a stored procedure?&lt;br /&gt;&lt;br /&gt;TRIGGER &lt;br /&gt;78.	What is Trigger? What is its use? What are the types of Triggers? What are the new kinds of triggers in sql 2000?&lt;br /&gt;Triggers are a special class of stored procedure defined to execute automatically when an UPDATE, INSERT, or DELETE statement is issued against a table or view. Triggers are powerful tools that sites can use to enforce their business rules automatically when data is modified.&lt;br /&gt;The CREATE TRIGGER statement can be defined with the FOR UPDATE, FOR INSERT, or FOR DELETE clauses to target a trigger to a specific class of data modification actions. When FOR UPDATE is specified, the IF UPDATE (column_name) clause can be used to target a trigger to updates affecting a particular column.&lt;br /&gt;You can use the FOR clause to specify when a trigger is executed: &lt;br /&gt;•	AFTER (default) - The trigger executes after the statement that triggered it completes. If the statement fails with an error, such as a constraint violation or syntax error, the trigger is not executed. AFTER triggers cannot be specified for views. &lt;br /&gt;•	INSTEAD OF -The trigger executes in place of the triggering action. INSTEAD OF triggers can be specified on both tables and views. You can define only one INSTEAD OF trigger for each triggering action (INSERT, UPDATE, and DELETE). INSTEAD OF triggers can be used to perform enhance integrity checks on the data values supplied in INSERT and UPDATE statements. INSTEAD OF triggers also let you specify actions that allow views, which would normally not support updates, to be updatable.&lt;br /&gt;An INSTEAD OF trigger can take actions such as: &lt;br /&gt;•	Ignoring parts of a batch. &lt;br /&gt;•	Not processing a part of a batch and logging the problem rows. &lt;br /&gt;•	Taking an alternative action if an error condition is encountered. &lt;br /&gt;In SQL Server 6.5 you could define only 3 triggers per table, one for INSERT, one for UPDATE and one for DELETE. From SQL Server 7.0 onwards, this restriction is gone, and you could create multiple triggers per each action. But in 7.0 there&#39;s no way to control the order in which the triggers fire. In SQL Server 2000 you could specify which trigger fires first or fires last using sp_settriggerorder.&lt;br /&gt;Till SQL Server 7.0, triggers fire only after the data modification operation happens. So in a way, they are called post triggers. But in SQL Server 2000 you could create pre triggers also. &lt;br /&gt;79.	When should one use &quot;instead of Trigger&quot;? Example&lt;br /&gt;CREATE TABLE BaseTable&lt;br /&gt;(&lt;br /&gt;PrimaryKey int IDENTITY(1,1),&lt;br /&gt;Color nvarchar(10) NOT NULL,&lt;br /&gt;Material nvarchar(10) NOT NULL,&lt;br /&gt;ComputedCol AS (Color + Material)&lt;br /&gt;)&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;--Create a view that contains all columns from the base table.&lt;br /&gt;CREATE VIEW InsteadView&lt;br /&gt;AS SELECT PrimaryKey, Color, Material, ComputedCol&lt;br /&gt;FROM BaseTable&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;--Create an INSTEAD OF INSERT trigger on tthe view.&lt;br /&gt;CREATE TRIGGER InsteadTrigger on InsteadView&lt;br /&gt;INSTEAD OF INSERT&lt;br /&gt;AS&lt;br /&gt;BEGIN&lt;br /&gt;--Build an INSERT statement ignoring inserrted.PrimaryKey and &lt;br /&gt;--inserted.ComputedCol.&lt;br /&gt;INSERT INTO BaseTable&lt;br /&gt;SELECT Color, Material&lt;br /&gt;FROM inserted&lt;br /&gt;END&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;-- can insert value to basetable by this insert into basetable(color,material) values (&#39;red&#39;,&#39;abc&#39;)&lt;br /&gt;&lt;br /&gt;-- insert into InsteadView(color,material)) values (&#39;red&#39;,&#39;abc&#39;) can&#39;t do this.&lt;br /&gt;-- It will give error &quot;&#39;PrimaryKey&#39; iin table &#39;InsteadView&#39; cannot be null.&quot;&lt;br /&gt;&lt;br /&gt;-- can insert value through table by this&lt;&lt;br /&gt;insert into InsteadView values (1,&#39;red&#39;,&#39;abc&#39;,1) --PrimaryKey, ComputedCol wont take values from here &lt;br /&gt;80.	Difference between trigger and stored procedure?&lt;br /&gt;Trigger will get execute automatically when an UPDATE, INSERT, or DELETE statement is issued against a table or view.&lt;br /&gt;We have to call stored procedure manually, or it can execute automatic when the SQL Server starts (You can use the sp_procoption system stored procedure to mark the stored procedure to automatic execution when the SQL Server will start. &lt;br /&gt;81.	The following trigger generates an e-mail whenever a new title is added.&lt;br /&gt;CREATE TRIGGER reminder&lt;br /&gt;ON titles&lt;br /&gt;FOR INSERT&lt;br /&gt;AS&lt;br /&gt;EXEC master..xp_sendmail &#39;MaryM&#39;, &#39;New title, mention in the next report to distributors.&#39; &lt;br /&gt;82.	Drawback of trigger? Its alternative solution?&lt;br /&gt;Triggers are generally used to implement business rules, auditing. Triggers can also be used to extend the referential integrity checks, but wherever possible, use constraints for this purpose, instead of triggers, as constraints are much faster.&lt;br /&gt;&lt;br /&gt;LOCK &lt;br /&gt;83.	What are locks?&lt;br /&gt;Microsoft® SQL Server™ 2000 uses locking to ensure transactional integrity and database consistency. Locking prevents users from reading data being changed by other users, and prevents multiple users from changing the same data at the same time. If locking is not used, data within the database may become logically incorrect, and queries executed against that data may produce unexpected results. &lt;br /&gt;84.	What are the different types of locks?&lt;br /&gt;SQL Server uses these resource lock modes. &lt;br /&gt;Lock mode	Description&lt;br /&gt;Shared (S)	Used for operations that do not change or update data (read-only operations), such as a SELECT statement.&lt;br /&gt;Update (U)	Used on resources that can be updated. Prevents a common form of deadlock that occurs when multiple sessions are reading, locking, and potentially updating resources later.&lt;br /&gt;Exclusive (X)	Used for data-modification operations, such as INSERT, UPDATE, or DELETE. Ensures that multiple updates cannot be made to the same resource at the same time.&lt;br /&gt;Intent	Used to establish a lock hierarchy. The types of intent locks are: intent shared (IS), intent exclusive (IX), and shared with intent exclusive (SIX).&lt;br /&gt;Schema	Used when an operation dependent on the schema of a table is executing. The types of schema locks are: schema modification (Sch-M) and schema stability (Sch-S). &lt;br /&gt;Bulk Update (BU)	Used when bulk-copying data into a table and the TABLOCK hint is specified.&lt;br /&gt;85.	What is a dead lock? Give a practical sample? How you can minimize the deadlock situation? What is a deadlock and what is a live lock? How will you go about resolving deadlocks?&lt;br /&gt;Deadlock is a situation when two processes, each having a lock on one piece of data, attempt to acquire a lock on the other&#39;s piece. Each process  would wait indefinitely for the other to release the lock, unless one of the user processes is terminated. SQL Server detects deadlocks and terminates one user&#39;s process.&lt;br /&gt;A livelock is one, where a request for an exclusive lock is repeatedly denied because a series of overlapping shared locks keeps interfering. SQL Server detects the situation after four denials and refuses further shared locks. (A livelock also occurs when read transactions monopolize a table or page, forcing a write transaction to wait indefinitely.) &lt;br /&gt;86.	What is isolation level?&lt;br /&gt;An isolation level determines the degree of isolation of data between concurrent transactions. The default SQL Server isolation level is Read Committed. A lower isolation level increases concurrency, but at the expense of data correctness. Conversely, a higher isolation level ensures that data is correct, but can affect concurrency negatively. The isolation level required by an application determines the locking behavior SQL Server uses.&lt;br /&gt;SQL-92 defines the following isolation levels, all of which are supported by SQL Server: &lt;br /&gt;•	Read uncommitted (the lowest level where transactions are isolated only enough to ensure that physically corrupt data is not read). &lt;br /&gt;•	Read committed (SQL Server default level). &lt;br /&gt;•	Repeatable read. &lt;br /&gt;•	Serializable (the highest level, where transactions are completely isolated from one another). &lt;br /&gt;Isolation level	Dirty read	Nonrepeatable read	Phantom&lt;br /&gt;Read uncommitted	Yes	Yes	Yes&lt;br /&gt;Read committed	No	Yes	Yes&lt;br /&gt;Repeatable read	No	No	Yes&lt;br /&gt;Serializable	No	No	No&lt;br /&gt;87.	Uncommitted Dependency (Dirty Read) - Uncommitted dependency occurs when a second transaction selects a row that is being updated by another transaction. The second transaction is reading data that has not been committed yet and may be changed by the transaction updating the row. For example, an editor is making changes to an electronic document. During the changes, a second editor takes a copy of the document that includes all the changes made so far, and distributes the document to the intended audience.&lt;br /&gt;Inconsistent Analysis (Nonrepeatable Read) Inconsistent analysis occurs when a second transaction accesses the same row several times and reads different data each time. Inconsistent analysis is similar to uncommitted dependency in that another transaction is changing the data that a second transaction is reading. However, in inconsistent analysis, the data read by the second transaction was committed by the transaction that made the change. Also, inconsistent analysis involves multiple reads (two or more) of the same row and each time the information is changed by another transaction; thus, the term nonrepeatable read. For example, an editor reads the same document twice, but between each reading, the writer rewrites the document. When the editor reads the document for the second time, it has changed.&lt;br /&gt;Phantom Reads Phantom reads occur when an insert or delete action is performed against a row that belongs to a range of rows being read by a transaction. The transaction&#39;s first read of the range of rows shows a row that no longer exists in the second or succeeding read, as a result of a deletion by a different transaction. Similarly, as the result of an insert by a different transaction, the transaction&#39;s second or succeeding read shows a row that did not exist in the original read. For example, an editor makes changes to a document submitted by a writer, but when the changes are incorporated into the master copy of the document by the production department, they find that new unedited material has been added to the document by the author. This problem could be avoided if no one could add new material to the document until the editor and production department finish working with the original document. &lt;br /&gt;88.	nolock? What is the difference between the REPEATABLE READ and SERIALIZE isolation levels?&lt;br /&gt;Locking Hints - A range of table-level locking hints can be specified using the SELECT, INSERT, UPDATE, and DELETE statements to direct Microsoft® SQL Server 2000 to the type of locks to be used. Table-level locking hints can be used when a finer control of the types of locks acquired on an object is required. These locking hints override the current transaction isolation level for the session. &lt;br /&gt;Locking hint	Description&lt;br /&gt;HOLDLOCK	Hold a shared lock until completion of the transaction instead of releasing the lock as soon as the required table, row, or data page is no longer required. HOLDLOCK is equivalent to SERIALIZABLE.&lt;br /&gt;NOLOCK	Do not issue shared locks and do not honor exclusive locks. When this option is in effect, it is possible to read an uncommitted transaction or a set of pages that are rolled back in the middle of a read. Dirty reads are possible. Only applies to the SELECT statement.&lt;br /&gt;PAGLOCK	Use page locks where a single table lock would usually be taken.&lt;br /&gt;READCOMMITTED	Perform a scan with the same locking semantics as a transaction running at the READ COMMITTED isolation level. By default, SQL Server 2000 operates at this isolation level.&lt;br /&gt;READPAST	Skip locked rows. This option causes a transaction to skip rows locked by other transactions that would ordinarily appear in the result set, rather than block the transaction waiting for the other transactions to release their locks on these rows. The READPAST lock hint applies only to transactions operating at READ COMMITTED isolation and will read only past row-level locks. Applies only to the SELECT statement.&lt;br /&gt;READUNCOMMITTED	Equivalent to NOLOCK.&lt;br /&gt;REPEATABLEREAD	Perform a scan with the same locking semantics as a transaction running at the REPEATABLE READ isolation level. &lt;br /&gt;ROWLOCK	Use row-level locks instead of the coarser-grained page- and table-level locks.&lt;br /&gt;SERIALIZABLE	Perform a scan with the same locking semantics as a transaction running at the SERIALIZABLE isolation level. Equivalent to HOLDLOCK.&lt;br /&gt;TABLOCK	Use a table lock instead of the finer-grained row- or page-level locks. SQL Server holds this lock until the end of the statement. However, if you also specify HOLDLOCK, the lock is held until the end of the transaction.&lt;br /&gt;TABLOCKX	Use an exclusive lock on a table. This lock prevents others from reading or updating the table and is held until the end of the statement or transaction.&lt;br /&gt;UPDLOCK	Use update locks instead of shared locks while reading a table, and hold locks until the end of the statement or transaction. UPDLOCK has the advantage of allowing you to read data (without blocking other readers) and update it later with the assurance that the data has not changed since you last read it.&lt;br /&gt;XLOCK	Use an exclusive lock that will be held until the end of the transaction on all data processed by the statement. This lock can be specified with either PAGLOCK or TABLOCK, in which case the exclusive lock applies to the appropriate level of granularity.&lt;br /&gt;89.	For example, if the transaction isolation level is set to SERIALIZABLE, and the table-level locking hint NOLOCK is used with the SELECT statement, key-range locks typically used to maintain serializable transactions are not taken.&lt;br /&gt;USE pubs&lt;br /&gt;GO&lt;br /&gt;SET TRANSACTION ISOLATION LEVEL SERIALIZABLE&lt;br /&gt;GO&lt;br /&gt;BEGIN TRANSACTION&lt;br /&gt;SELECT au_lname FROM authors WITH (NOLOCK)&lt;br /&gt;GO &lt;br /&gt;90.	What is escalation of locks?&lt;br /&gt;Lock escalation is the process of converting a lot of low level locks (like row locks, page locks) into higher level locks (like table locks). Every lock is a memory structure too many locks would mean, more memory being occupied by locks. To prevent this from happening, SQL Server escalates the many fine-grain locks to fewer coarse-grain locks. Lock escalation threshold was definable in SQL Server 6.5, but from SQL Server 7.0 onwards it&#39;s dynamically managed by SQL Server.&lt;br /&gt;&lt;br /&gt;VIEW &lt;br /&gt;91.	What is View? Use? Syntax of View?&lt;br /&gt;A view is a virtual table made up of data from base tables and other views, but not stored separately. &lt;br /&gt;•	Views simplify users perception of the database (can be used to present only the necessary information while hiding details in underlying relations) &lt;br /&gt;•	Views improve data security preventing undesired accesses &lt;br /&gt;•	Views facilite the provision of additional data independence &lt;br /&gt;92.	Does the View occupy memory space?&lt;br /&gt;No &lt;br /&gt;93.	Can u drop a table if it has a view?&lt;br /&gt;Views or tables participating in a view created with the SCHEMABINDING clause cannot be dropped. If the view is not created using SCHEMABINDING, then we can drop the table. &lt;br /&gt;94.	Why doesn&#39;t SQL Server permit an ORDER BY clause in the definition of a view?&lt;br /&gt;SQL Server excludes an ORDER BY clause from a view to comply with the ANSI SQL-92 standard. Because analyzing the rationale for this standard requires a discussion of the underlying structure of the structured query language (SQL) and the mathematics upon which it is based, we can&#39;t fully explain the restriction here. However, if you need to be able to specify an ORDER BY clause in a view, consider using the following workaround:&lt;br /&gt;USE pubs&lt;br /&gt;GO &lt;br /&gt;CREATE VIEW AuthorsByName&lt;br /&gt;AS&lt;br /&gt;SELECT TOP 100 PERCENT *&lt;br /&gt;FROM authors &lt;br /&gt;ORDER BY au_lname, au_fname&lt;br /&gt;GO&lt;br /&gt;The TOP construct, which Microsoft introduced in SQL Server 7.0, is most useful when you combine it with the ORDER BY clause. The only time that SQL Server supports an ORDER BY clause in a view is when it is used in conjunction with the TOP keyword. (Note that the TOP keyword is a SQL Server extension to the ANSI SQL-92 standard.)&lt;br /&gt;&lt;br /&gt;TRANSACTION &lt;br /&gt;95.	What is Transaction?&lt;br /&gt;A transaction is a sequence of operations performed as a single logical unit of work. A logical unit of work must exhibit four properties, called the ACID (Atomicity, Consistency, Isolation, and Durability) properties, to qualify as a transaction: &lt;br /&gt;•	Atomicity - A transaction must be an atomic unit of work; either all of its data modifications are performed or none of them is performed. &lt;br /&gt;•	Consistency - When completed, a transaction must leave all data in a consistent state. In a relational database, all rules must be applied to the transaction&#39;s modifications to maintain all data integrity. All internal data structures, such as B-tree indexes or doubly-linked lists, must be correct at the end of the transaction. &lt;br /&gt;•	Isolation - Modifications made by concurrent transactions must be isolated from the modifications made by any other concurrent transactions. A transaction either sees data in the state it was in before another concurrent transaction modified it, or it sees the data after the second transaction has completed, but it does not see an intermediate state. This is referred to as serializability because it results in the ability to reload the starting data and replay a series of transactions to end up with the data in the same state it was in after the original transactions were performed. &lt;br /&gt;•	Durability - After a transaction has completed, its effects are permanently in place in the system. The modifications persist even in the event of a system failure. &lt;br /&gt;96.	After one Begin Transaction a truncate statement and a RollBack statements are there. Will it be rollbacked? Since the truncate statement does not perform logged operation how does it RollBack?&lt;br /&gt;It will rollback.&lt;br /&gt;&lt;br /&gt;DELETE is a logged operation on a per row basis.  This means that the deletion of each row gets logged and physically deleted.&lt;br /&gt;You can DELETE any row that will not violate a constraint, while leaving the foreign key or any other contraint in place.&lt;br /&gt;TRUNCATE is also a logged operation, but in a different way.  TRUNCATE logs the deallocation of the data pages in which the data exists.  The deallocation of data pages means that your data rows still actually exist in the data pages, but the extents have been marked as empty for reuse.  This is what makes TRUNCATE a faster operation to perform over DELETE.&lt;br /&gt;You cannot TRUNCATE a table that has any foreign key constraints.  You will have to remove the contraints, TRUNCATE the table, and reapply the contraints.&lt;br /&gt;TRUNCATE will reset any identity columns to the default seed value.  This means if you have a table with an identity column and you have 264 rows with a seed value of 1, your last record will have the value 264 (assuming you started with value 1) in its identity columns.  After TRUNCATEing your table, when you insert a new record into the empty table, the identity column will have a value of 1.  DELETE will not do this.  In the same scenario, if you DELETEd your rows, when inserting a new row into the empty table, the identity column will have a value of 265.&lt;br /&gt;You can use TRUNCATE within a transaction, and when this transaction is rolled-back, the data pages are reallocated again and the database is again in its original, consistent state.&lt;br /&gt;&lt;br /&gt;97.	Given a SQL like &lt;br /&gt;Begin Tran&lt;br /&gt;   Select @@Rowcount&lt;br /&gt;Begin Tran&lt;br /&gt;   Select @@Rowcount&lt;br /&gt;Begin Tran&lt;br /&gt;   Select @@Rowcount&lt;br /&gt;Commit Tran&lt;br /&gt;   Select @@Rowcount&lt;br /&gt;RollBack&lt;br /&gt;   Select @@Rowcount&lt;br /&gt;RollBack&lt;br /&gt;   Select @@Rowcount&lt;br /&gt;What is the value of @@Rowcount at each stmt levels?&lt;br /&gt;Ans : 0 – zero.&lt;br /&gt;@@ROWCOUNT - Returns the number of rows affected by the last statement.&lt;br /&gt;@@TRANCOUNT - Returns the number of active transactions for the current connection.&lt;br /&gt;Each Begin Tran will add count, each commit will reduce count and ONE rollback will make it 0.&lt;br /&gt;&lt;br /&gt;OTHER &lt;br /&gt;98.	What are the constraints for Table Constraints define rules regarding the values allowed in columns and are the standard mechanism for enforcing integrity. SQL Server 2000 supports five classes of constraints.&lt;br /&gt;NOT NULL&lt;br /&gt;CHECK&lt;br /&gt;UNIQUE&lt;br /&gt;PRIMARY KEY&lt;br /&gt;FOREIGN KEY &lt;br /&gt;99.	There are 50 columns in a table. Write a query to get first 25 columns&lt;br /&gt;Ans: Need to mention each column names. &lt;br /&gt;100.	How to list all the tables in a particular database?&lt;br /&gt;USE pubs&lt;br /&gt;GO&lt;br /&gt;sp_help &lt;br /&gt;101.	What are cursors? Explain different types of cursors. What are the disadvantages of cursors? How can you avoid cursors?&lt;br /&gt;Cursors allow row-by-row processing of the result sets.&lt;br /&gt;Types of cursors: Static, Dynamic, Forward-only, Keyset-driven.&lt;br /&gt;Disadvantages of cursors: Each time you fetch a row from the cursor, it results in a network roundtrip. Cursors are also costly because they require more resources and temporary storage (results in more IO operations). Further, there are restrictions on the SELECT statements that can be used with some types of cursors.&lt;br /&gt;How to avoid cursor: &lt;br /&gt;0.	Most of the times, set based operations can be used instead of cursors. Here is an example: If you have to give a flat hike to your employees using the following criteria:&lt;br /&gt;Salary between 30000 and 40000 -- 5000 hike&lt;br /&gt;Salary between 40000 and 55000 -- 7000 hike&lt;br /&gt;Salary between 55000 and 65000 -- 9000 hike&lt;br /&gt;In this situation many developers tend to use a cursor, determine each employee&#39;s salary and update his salary according to the above formula. But the same can be achieved by multiple update statements or can be combined in a single UPDATE statement as shown below:&lt;br /&gt;UPDATE tbl_emp SET salary =&lt;br /&gt;CASE WHEN salary BETWEEN 30000 AND 40000 THEN salary + 5000&lt;br /&gt;WHEN salary BETWEEN 40000 AND 55000 THEN salary + 7000&lt;br /&gt;WHEN salary BETWEEN 55000 AND 65000 THEN salary + 10000&lt;br /&gt;END &lt;br /&gt;1.	You need to call a stored procedure when a column in a particular row meets certain condition. You don&#39;t have to use cursors for this. This can be achieved using WHILE loop, as long as there is a unique key to identify each row. For examples of using WHILE loop for row by row processing, check out the &#39;My code library&#39; section of my site or search for WHILE. &lt;br /&gt;102.	What is Dynamic Cursor? Suppose, I have a dynamic cursor attached to table in a database.  I have another means by which I will modify the table.  What do you think will the values in the cursor be?&lt;br /&gt;Dynamic cursors reflect all changes made to the rows in their result set when scrolling through the cursor. The data values, order, and membership of the rows in the result set can change on each fetch. All UPDATE, INSERT, and DELETE statements made by all users are visible through the cursor. Updates are visible immediately if they are made through the cursor using either an API function such as SQLSetPos or the Transact-SQL WHERE CURRENT OF clause. Updates made outside the cursor are not visible until they are committed, unless the cursor transaction isolation level is set to read uncommitted. &lt;br /&gt;103.	What is DATEPART?&lt;br /&gt;Returns an integer representing the specified datepart of the specified date. &lt;br /&gt;104.	Difference between Delete and Truncate?&lt;br /&gt;TRUNCATE TABLE is functionally identical to DELETE statement with no WHERE clause: both remove all rows in the table.&lt;br /&gt;(1) But TRUNCATE TABLE is faster and uses fewer system and transaction log resources than DELETE. The DELETE statement removes rows one at a time and records an entry in the transaction log for each deleted row. TRUNCATE TABLE removes the data by deallocating the data pages used to store the table&#39;s data, and only the page deallocations are recorded in the transaction log.&lt;br /&gt;(2) Because TRUNCATE TABLE is not logged, it cannot activate a trigger.&lt;br /&gt;(3) The counter used by an identity for new rows is reset to the seed for the column. If you want to retain the identity counter, use DELETE instead.&lt;br /&gt;Of course, TRUNCATE TABLE can be rolled back. &lt;br /&gt;105.	Given a scenario where two operations, Delete Stmt and Truncate Stmt, where the Delete Statement was successful and the truncate stmt was failed. – Can u judge why?&lt;br /&gt;** &lt;br /&gt;106.	What are global variables? Tell me some of them?&lt;br /&gt;Transact-SQL global variables are a form of function and are now referred to as functions.&lt;br /&gt;ABS - Returns the absolute, positive value of the given numeric expression.&lt;br /&gt;SUM&lt;br /&gt;AVG&lt;br /&gt;AND &lt;br /&gt;107.	What is DDL?&lt;br /&gt;Data definition language (DDL) statements are SQL statements that support the definition or declaration of database objects (for example, CREATE TABLE, DROP TABLE, and ALTER TABLE).&lt;br /&gt;You can use the ADO Command object to issue DDL statements. To differentiate DDL statements from a table or stored procedure name, set the CommandType property of the Command object to adCmdText. Because executing DDL queries with this method does not generate any recordsets, there is no need for a Recordset object. &lt;br /&gt;108.	What is DML?&lt;br /&gt;Data Manipulation Language (DML), which is used to select, insert, update, and delete data in the objects defined using DDL &lt;br /&gt;109.	What are keys in RDBMS? What is a primary key/ foreign key?&lt;br /&gt;There are two kinds of keys.&lt;br /&gt;A primary key is a set of columns from a table that are guaranteed to have unique values for each row of that table.&lt;br /&gt;Foreign keys are attributes of one table that have matching values in a primary key in another table, allowing for relationships between tables. &lt;br /&gt;110.	What is the difference between Primary Key and Unique Key?&lt;br /&gt;Both primary key and unique key enforce uniqueness of the column on which they are defined. But by default primary key creates a clustered index on the column, where are unique creates a nonclustered index by default. Another major difference is that, primary key doesn&#39;t allow NULLs, but unique key allows one NULL only. &lt;br /&gt;111.	Define candidate key, alternate key, composite key?&lt;br /&gt;A candidate key is one that can identify each row of a table uniquely. Generally a candidate key becomes the primary key of the table. If the table has more than one candidate key, one of them will become the primary key, and the rest are called alternate keys. &lt;br /&gt;A key formed by combining at least two or more columns is called composite key. &lt;br /&gt;112.	What is the Referential Integrity?&lt;br /&gt;Referential integrity refers to the consistency that must be maintained between primary and foreign keys, i.e. every foreign key value must have a corresponding primary key value. &lt;br /&gt;113.	What are defaults? Is there a column to which a default can&#39;t be bound?&lt;br /&gt;A default is a value that will be used by a column, if no value is supplied to that column while inserting data. IDENTITY columns and timestamp columns can&#39;t have defaults bound to them. &lt;br /&gt;114.	What is Query optimization? How is tuning a performance of query done? &lt;br /&gt;115.	What is the use of trace utility?&lt;br /&gt;** &lt;br /&gt;116.	What is the use of shell commands? xp_cmdshell&lt;br /&gt;Executes a given command string as an operating-system command shell and returns any output as rows of text. Grants nonadministrative users permissions to execute xp_cmdshell. &lt;br /&gt;117.	What is use of shrink database?&lt;br /&gt;Microsoft® SQL Server 2000 allows each file within a database to be shrunk to remove unused pages. Both data and transaction log files can be shrunk. &lt;br /&gt;118.	If the performance of the query suddenly decreased where you will check? &lt;br /&gt;119.	What is a pass-through query?&lt;br /&gt;Microsoft® SQL Server 2000 sends pass-through queries as un-interpreted query strings to an OLE DB data source. The query must be in a syntax the OLE DB data source will accept. A Transact-SQL statement uses the results from a pass-through query as though it is a regular table reference.&lt;br /&gt;This example uses a pass-through query to retrieve a result set from a Microsoft Access version of the Northwind sample database.&lt;br /&gt;SELECT *&lt;br /&gt;FROM OpenRowset(&#39;Microsoft.Jet.OLEDB.4.0&#39;, &lt;br /&gt;&#39;c:\northwind.mdb&#39;;&#39;admin&#39;; &#39;&#39;, &lt;br /&gt;&#39;SELECT CustomerID, CompanyName&lt;br /&gt;FROM Customers&lt;br /&gt;WHERE Region = &#39;&#39;WA&#39;&#39; &#39;) &lt;br /&gt;120.	How do you differentiate Local and Global Temporary table?&lt;br /&gt;You can create local and global temporary tables. Local temporary tables are visible only in the current session; global temporary tables are visible to all sessions. Prefix local temporary table names with single number sign (#table_name), and prefix global temporary table names with a double number sign (##table_name). SQL statements reference the temporary table using the value specified for table_name in the CREATE TABLE statement:&lt;br /&gt;CREATE TABLE #MyTempTable (cola INT PRIMARY KEY)&lt;br /&gt;INSERT INTO #MyTempTable VALUES (1) &lt;br /&gt;121.	How the Exists keyword works in SQL Server?&lt;br /&gt;USE pubs&lt;br /&gt;SELECT au_lname, au_fname&lt;br /&gt;FROM authors&lt;br /&gt;WHERE exists&lt;br /&gt;   (SELECT *&lt;br /&gt;   FROM publishers&lt;br /&gt;   WHERE authors.city = publishers.city)&lt;br /&gt;When a subquery is introduced with the keyword EXISTS, it functions as an existence test. The WHERE clause of the outer query tests for the existence of rows returned by the subquery. The subquery does not actually produce any data; it returns a value of TRUE or FALSE. &lt;br /&gt;122.	ANY?&lt;br /&gt;USE pubs&lt;br /&gt;SELECT au_lname, au_fname&lt;br /&gt;FROM authors&lt;br /&gt;WHERE city = ANY&lt;br /&gt;(SELECT city&lt;br /&gt;FROM publishers) &lt;br /&gt;123.	to select date part only&lt;br /&gt;SELECT CONVERT(char(10),GetDate(),101)&lt;br /&gt;--to select time part only&lt;br /&gt;SELECT right(GetDate(),7) &lt;br /&gt;124.	How can I send a message to user from the SQL Server? &lt;br /&gt;You can use the xp_cmdshell extended stored procedure to run net send command. This is the example to send the &#39;Hello&#39; message to JOHN:&lt;br /&gt;EXEC master..xp_cmdshell &quot;net send JOHN &#39;Hello&#39;&quot;&lt;br /&gt;To get net send message on the Windows 9x machines, you should run the WinPopup utility. You can place WinPopup in the Startup group under Program Files. &lt;br /&gt;125.	What is normalization? Explain different levels of normalization? Explain Third normalization form with an example?&lt;br /&gt;The process of refining tables, keys, columns, and relationships to create an efficient database is called normalization. This should eliminates unnecessary duplication and provides a rapid search path to all necessary information.&lt;br /&gt;Some of the benefits of normalization are: &lt;br /&gt;•	Data integrity (because there is no redundant, neglected data) &lt;br /&gt;•	Optimized queries (because normalized tables produce rapid, efficient joins) &lt;br /&gt;•	Faster index creation and sorting (because the tables have fewer columns) &lt;br /&gt;•	Faster UPDATE performance (because there are fewer indexes per table) &lt;br /&gt;•	Improved concurrency resolution (because table locks will affect less data) &lt;br /&gt;•	Eliminate redundancy &lt;br /&gt;There are a few rules for database normalization. Each rule is called a &quot;normal form.&quot; If the first rule is observed, the database is said to be in &quot;first normal form.&quot; If the first three rules are observed, the database is considered to be in &quot;third normal form.&quot; Although other levels of normalization are possible, third normal form is considered the highest level necessary for most applications. &lt;br /&gt;6.	First Normal Form (1NF) &lt;br /&gt;•	Eliminate repeating groups in individual tables &lt;br /&gt;•	Create a separate table for each set of related data. &lt;br /&gt;•	Identify each set of related data with a primary key. &lt;br /&gt;Do not use multiple fields in a single table to store similar data. &lt;br /&gt;Example &lt;br /&gt; 	Subordinate1 	Subordinate2 	Subordinate3 	Subordinate4 &lt;br /&gt;Bob 	Jim 	Mary 	Beth 	  &lt;br /&gt;Mary 	Mike 	Jason 	Carol 	Mark &lt;br /&gt;Jim 	Alan 	  	  	  &lt;br /&gt;Eliminate duplicative columns from the same table.  Clearly, the Subordinate1-Subordinate4 columns are duplicative. What happens when we need to add or remove a subordinate? &lt;br /&gt; 	Subordinates&lt;br /&gt;Bob 	Jim, Mary, Beth&lt;br /&gt;Mary 	Mike, Jason, Carol, Mark &lt;br /&gt;Jim 	Alan&lt;br /&gt;This solution is closer, but it also falls short of the mark. The subordinates column is still duplicative and non-atomic. What happens when we need to add or remove a subordinate? We need to read and write the entire contents of the table. That’s not a big deal in this situation, but what if one manager had one hundred employees? Also, it complicates the process of selecting data from the database in future queries. &lt;br /&gt;Solution:&lt;br /&gt; 	Subordinate &lt;br /&gt;Bob 	Jim &lt;br /&gt;Bob 	Mary &lt;br /&gt;Bob 	Beth &lt;br /&gt;Mary 	Mike &lt;br /&gt;Mary 	Jason &lt;br /&gt;Mary 	Carol &lt;br /&gt;Mary 	Mark &lt;br /&gt;Jim 	Alan &lt;br /&gt;7.	Second Normal Form (2NF) &lt;br /&gt;•	Create separate tables for sets of values that apply to multiple records. &lt;br /&gt;•	Relate these tables with a foreign key. &lt;br /&gt;Records should not depend on anything other than a table&#39;s primary key (a compound key, if necessary). &lt;br /&gt;For example, consider a customer&#39;s address in an accounting system. The address is needed by the Customers table, but also by the Orders, Shipping, Invoices, Accounts Receivable, and Collections tables. Instead of storing the customer&#39;s address as a separate entry in each of these tables, store it in one place, either in the Customers table or in a separate Addresses table. &lt;br /&gt;8.	Third Normal Form (3NF) &lt;br /&gt;•	Eliminate fields that do not depend on the key. &lt;br /&gt;Values in a record that are not part of that record&#39;s key do not belong in the table. In general, any time the contents of a group of fields may apply to more than a single record in the table, consider placing those fields in a separate table.&lt;br /&gt;For example, in an Employee Recruitment table, a candidate&#39;s university name and address may be included. But you need a complete list of universities for group mailings. If university information is stored in the Candidates table, there is no way to list universities with no current candidates. Create a separate Universities table and link it to the Candidates table with a university code key.&lt;br /&gt;Another Example : &lt;br /&gt;MemberId	Name	Company	CompanyLoc&lt;br /&gt;1	John Smith	ABC	Alabama&lt;br /&gt;2	Dave Jones	MCI	Florida&lt;br /&gt;The Member table satisfies first normal form - it contains no repeating groups. It satisfies second normal form - since it doesn&#39;t have a multivalued key. But the key is MemberID, and the company name and location describe only a company, not a member. To achieve third normal form, they must be moved into a separate table. Since they describe a company, CompanyCode becomes the key of the new &quot;Company&quot; table.&lt;br /&gt;The motivation for this is the same for second normal form: we want to avoid update and delete anomalies. For example, suppose no members from the IBM were currently stored in the database. With the previous design, there would be no record of its existence, even though 20 past members were from IBM!&lt;br /&gt;Member Table &lt;br /&gt;MemberId	Name	CID&lt;br /&gt;1	John Smith	1&lt;br /&gt;2	Dave Jones	2&lt;br /&gt;&lt;br /&gt;Company Table &lt;br /&gt;CId	Name	Location&lt;br /&gt;1	ABC	Alabama&lt;br /&gt;2	MCI	Florida&lt;br /&gt;9.	Boyce-Codd Normal Form (BCNF)&lt;br /&gt;A relation is in Boyce/Codd normal form if and only if the only determinants are candidate key. Its a different version of 3NF, indeed, was meant to replace it. [A determinant is any attribute on which some other attribute is (fully) functionally dependent.] &lt;br /&gt;10.	4th Normal Form (4NF)&lt;br /&gt;A table is in 4NF if it is in BCNF and if it has no multi-valued dependencies. This applies primarily to key-only associative tables, and appears as a ternary relationship, but has incorrectly merged 2 distinct, independent relationships.&lt;br /&gt;Eg: This could be any 2 M:M relationships from a single entity. For instance, a member could know many software tools, and a software tool may be used by many members. Also, a member could have recommended many books, and a book could be recommended by many members. &lt;br /&gt;Software	  &lt;br /&gt;________________________________________	member	  &lt;br /&gt;________________________________________	Book&lt;br /&gt;11.	The correct solution, to cause the model to be in 4th normal form, is to ensure that all M:M relationships are resolved independently if they are indeed independent.&lt;br /&gt;Software	  &lt;br /&gt;________________________________________	membersoftware	  &lt;br /&gt;________________________________________	member	  &lt;br /&gt;________________________________________	memberBook	  &lt;br /&gt;________________________________________	book&lt;br /&gt;12.	5th Normal Form (5NF)(PJNF)&lt;br /&gt;A table is in 5NF, also called &quot;Projection-Join Normal Form&quot;, if it is in 4NF and if every join dependency in the table is a consequence of the candidate keys of the table. &lt;br /&gt;13.	Domain/key normal form (DKNF). A key uniquely identifies each row in a table. A domain is the set of permissible values for an attribute. By enforcing key and domain restrictions, the database is assured of being freed from modification anomalies. DKNF is the normalization level that most designers aim to achieve. &lt;br /&gt;**&lt;br /&gt;Remember, these normalization guidelines are cumulative.  For a database to be in 2NF, it must first fulfill all the criteria of a 1NF database. &lt;br /&gt;126.	If a database is normalized by 3 NF then how many number of tables it should contain in minimum? How many minimum if 2NF and 1 NF? &lt;br /&gt;127.	What is denormalization and when would you go for it?&lt;br /&gt;As the name indicates, denormalization is the reverse process of normalization. It&#39;s the controlled introduction of redundancy in to the database design. It helps improve the query performance as the number of joins could be reduced. &lt;br /&gt;128.	How can I randomly sort query results? &lt;br /&gt;To randomly order rows, or to return x number of randomly chosen rows, you can use the RAND function inside the SELECT statement. But the RAND function is resolved only once for the entire query, so every row will get same value. You can use an ORDER BY clause to sort the rows by the result from the NEWID function, as the following code shows:&lt;br /&gt;SELECT *&lt;br /&gt;FROM Northwind..Orders &lt;br /&gt;ORDER BY NEWID() &lt;br /&gt;129.	sp_who&lt;br /&gt;Provides information about current Microsoft® SQL Server™ users and processes. The information returned can be filtered to return only those processes that are not idle. &lt;br /&gt;130.	Have you worked on Dynamic SQL? How will You handled “ (Double Quotes) in Dynamic SQL? &lt;br /&gt;131.	How to find dependents of a table?&lt;br /&gt;Verify dependencies with sp_depends before dropping an object &lt;br /&gt;132.	What is the difference between a CONSTRAINT AND RULE?&lt;br /&gt;Rules are a backward-compatibility feature that perform some of the same functions as CHECK constraints. CHECK constraints are the preferred, standard way to restrict the values in a column. CHECK constraints are also more concise than rules; there can only be one rule applied to a column, but multiple CHECK constraints can be applied. CHECK constraints are specified as part of the CREATE TABLE statement, while rules are created as separate objects and then bound to the column. &lt;br /&gt;133.	How to call a COM dll from SQL Server 2000?&lt;br /&gt;sp_OACreate - Creates an instance of the OLE object on an instance of Microsoft® SQL Server&lt;br /&gt;Syntax&lt;br /&gt;sp_OACreate progid, | clsid, &lt;br /&gt;    objecttoken OUTPUT &lt;br /&gt;    [ , context ] &lt;br /&gt;context - Specifies the execution context in which the newly created OLE object runs. If specified, this value must be one of the following:&lt;br /&gt;1 = In-process (.dll) OLE server only&lt;br /&gt;4 = Local (.exe) OLE server only&lt;br /&gt;5 = Both in-process and local OLE server allowed&lt;br /&gt;Examples&lt;br /&gt;A. Use Prog ID - This example creates a SQL-DMO SQLServer object by using its ProgID.&lt;br /&gt;DECLARE @object int&lt;br /&gt;DECLARE @hr int&lt;br /&gt;DECLARE @src varchar(255), @desc varchar(255)&lt;br /&gt;EXEC @hr = sp_OACreate &#39;SQLDMO.SQLServer&#39;, @object OUT&lt;br /&gt;IF @hr &lt;&gt; 0&lt;br /&gt;BEGIN&lt;br /&gt;   EXEC sp_OAGetErrorInfo @object, @src OUT, @desc OUT &lt;br /&gt;   SELECT hr=convert(varbinary(4),@hr), Source=@src, Description=@desc&lt;br /&gt;    RETURN&lt;br /&gt;END&lt;br /&gt;B. Use CLSID - This example creates a SQL-DMO SQLServer object by using its CLSID.&lt;br /&gt;DECLARE @object int&lt;br /&gt;DECLARE @hr int&lt;br /&gt;DECLARE @src varchar(255), @desc varchar(255)&lt;br /&gt;EXEC @hr = sp_OACreate &#39;{00026BA1-0000-0000-C000-000000000046}&#39;,&lt;br /&gt;    @object OUT&lt;br /&gt;IF @hr &lt;&gt; 0&lt;br /&gt;BEGIN&lt;br /&gt;   EXEC sp_OAGetErrorInfo @object, @src OUT, @desc OUT &lt;br /&gt;   SELECT hr=convert(varbinary(4),@hr), Source=@src, Description=@desc&lt;br /&gt;    RETURN&lt;br /&gt;END&lt;br /&gt;134.	Difference between sysusers and syslogins?&lt;br /&gt;sysusers - Contains one row for each Microsoft® Windows user, Windows group, Microsoft SQL Server™ user, or SQL Server role in the database.&lt;br /&gt;syslogins - Contains one row for each login account. &lt;br /&gt;135.	What is the row size in SQL Server 2000?&lt;br /&gt;8060 bytes. – close to 8Kb&lt;br /&gt;136.	How will you find structure of table, all tables/views in one db, all dbs?&lt;br /&gt;//structure of table&lt;br /&gt;sp_helpdb tbl_emp&lt;br /&gt;&lt;br /&gt;//list of all databases&lt;br /&gt;sp_helpdb&lt;br /&gt;OR&lt;br /&gt;SELECT * FROM master.dbo.sysdatabases&lt;br /&gt;&lt;br /&gt;//details about database pubs. .mdf, .ldf file locations, size of database&lt;br /&gt;sp_helpdb pubs&lt;br /&gt;&lt;br /&gt;//lists all tables under current database&lt;br /&gt;sp_tables&lt;br /&gt;OR&lt;br /&gt;SELECT * FROM information_schema.tables WHERE (table_type = &#39;base table&#39;)&lt;br /&gt;OR&lt;br /&gt;SELECT * FROM sysobjects WHERE type = &#39;U&#39; //faster &lt;br /&gt;137.	B-tree indexes or doubly-linked lists? &lt;br /&gt;138.	What is the system function to get the current user&#39;s user id? &lt;br /&gt;USER_ID(). Also check out other system functions like USER_NAME(), SYSTEM_USER, SESSION_USER, CURRENT_USER, USER, SUSER_SID(), HOST_NAME(). &lt;br /&gt;139.	What are the series of steps that happen on execution of a query in a Query Analyzer?&lt;br /&gt;1) Syntax checking 2) Parsing 3) Execution plan &lt;br /&gt;140.	Which event (Check constraints, Foreign Key, Rule, trigger, Primary key check) will be performed last for integrity check?&lt;br /&gt;Identity Insert Check&lt;br /&gt;Nullability constraint&lt;br /&gt;Data type check&lt;br /&gt;Instead of trigger&lt;br /&gt;Primary key&lt;br /&gt;Check constraint&lt;br /&gt;Foreign key&lt;br /&gt;DML Execution (update statements)&lt;br /&gt;After Trigger&lt;br /&gt;** &lt;br /&gt;141.	How will you show many to many relation in sql?&lt;br /&gt;Create 3rd table with 2 columns which having one to many relation to these tables. &lt;br /&gt;142.	When a query is sent to the database and an index is not being used, what type of execution is taking place?&lt;br /&gt;A table scan. &lt;br /&gt;143.	What is #, ##, @, @@ means?&lt;br /&gt;@@ - System variables&lt;br /&gt;@ - user defined variables &lt;br /&gt;144.	What is the difference between a Local temporary table and a Global temporary table? How is each one denoted?&lt;br /&gt;Local temporary table will be accessible to only current user session, its name will be preceded with a single hash (#mytable)&lt;br /&gt;Global temporary table will be accessible to all users, &amp; it will be dropped only after ending of all active connections, its name will be preceded with double hash (##mytable) &lt;br /&gt;145.	What is covered queries in SQL Server? &lt;br /&gt;146.	What is HASH JOIN, MERGE JOIN?&lt;br /&gt;&lt;br /&gt;TOOLS &lt;br /&gt;147.	Have you ever used DBCC command? Give an example for it.&lt;br /&gt;The Transact-SQL programming language provides DBCC statements that act as Database Console Commands for Microsoft® SQL Serve 2000. These statements check the physical and logical consistency of a database. Many DBCC statements can fix detected problems. Database Console Command statements are grouped into these categories.&lt;br /&gt;Statement category	Perform&lt;br /&gt;Maintenance statements	Maintenance tasks on a database, index, or filegroup. &lt;br /&gt;Miscellaneous statements	Miscellaneous tasks such as enabling row-level locking or removing a dynamic-link library (DLL) from memory.&lt;br /&gt;Status statements	Status checks.&lt;br /&gt;Validation statements	Validation operations on a database, table, index, catalog, filegroup, system tables, or allocation of database pages.&lt;br /&gt;DBCC CHECKDB, DBCC CHECKTABLE, DBCC CHECKCATALOG, DBCC CHECKALLOC, DBCC SHOWCONTIG, DBCC SHRINKDATABASE, DBCC SHRINKFILE etc.&lt;br /&gt;148.	How do you use DBCC statements to monitor various aspects of a SQL server installation?&lt;br /&gt;** &lt;br /&gt;149.	What is the output of DBCC Showcontig statement?&lt;br /&gt;Displays fragmentation information for the data and indexes of the specified table. &lt;br /&gt;150.	How do I reset the identity column?&lt;br /&gt;You can use the DBCC CHECKIDENT statement, if you want to reset or reseed the identity column. For example, if you need to force the current identity value in the jobs table to a value of 100, you can use the following:&lt;br /&gt;USE pubs&lt;br /&gt;GO&lt;br /&gt;DBCC CHECKIDENT (jobs, RESEED, 100)&lt;br /&gt;GO &lt;br /&gt;151.	About SQL Command line executables &lt;br /&gt;Utilities&lt;br /&gt;bcp&lt;br /&gt;console&lt;br /&gt;isql&lt;br /&gt;sqlagent&lt;br /&gt;sqldiag&lt;br /&gt;sqlmaint&lt;br /&gt;sqlservr&lt;br /&gt;vswitch&lt;br /&gt;dtsrun&lt;br /&gt;dtswiz&lt;br /&gt;isqlw&lt;br /&gt;itwiz&lt;br /&gt;odbccmpt&lt;br /&gt;osql&lt;br /&gt;rebuildm&lt;br /&gt;sqlftwiz&lt;br /&gt;distrib&lt;br /&gt;logread&lt;br /&gt;replmerg&lt;br /&gt;snapshot&lt;br /&gt;scm&lt;br /&gt;regxmlss&lt;br /&gt;152.	What is DTC?&lt;br /&gt;The Microsoft Distributed Transaction Coordinator (MS DTC) is a transaction manager that allows client applications to include several different sources of data in one transaction. MS DTC coordinates committing the distributed transaction across all the servers enlisted in the transaction. &lt;br /&gt;153.	What is DTS? Any drawbacks in using DTS?&lt;br /&gt;Microsoft® SQL Server™ 2000 Data Transformation Services (DTS) is a set of graphical tools and programmable objects that lets you extract, transform, and consolidate data from disparate sources into single or multiple destinations. &lt;br /&gt;154.	What is BCP?&lt;br /&gt;The bcp utility copies data between an instance of Microsoft® SQL Server™ 2000 and a data file in a user-specified format.&lt;br /&gt;C:\Documents and Settings\sthomas&gt;bcp&lt;br /&gt;usage: bcp {dbtable | query} {in | out | queryout | format} datafile&lt;br /&gt;[-m maxerrors] [-f formatfile] [-e errfile]&lt;br /&gt;[-F firstrow] [-L lastrow] [-b batchsize]&lt;br /&gt;[-n native type] [-c character type] [-w wide character type]&lt;br /&gt;[-N keep non-text native] [-V file format version] [-q quoted identifier]&lt;br /&gt;[-C code page specifier] [-t field terminator] [-r row terminator]&lt;br /&gt;[-i inputfile] [-o outfile] [-a packetsize]&lt;br /&gt;[-S server name] [-U username] [-P password]&lt;br /&gt;[-T trusted connection] [-v version] [-R regional enable]&lt;br /&gt;[-k keep null values] [-E keep identity values]&lt;br /&gt;[-h &quot;load hints&quot;] &lt;br /&gt;155.	How can I create a plain-text flat file from SQL Server as input to another application?&lt;br /&gt;One of the purposes of Extensible Markup Language (XML) is to solve challenges like this, but until all applications become XML-enabled, consider using our faithful standby, the bulk copy program (bcp) utility. This utility can do more than just dump a table; bcp also can take its input from a view instead of from a table. After you specify a view as the input source, you can limit the output to a subset of columns or to a subset of rows by selecting appropriate filtering (WHERE and HAVING) clauses.&lt;br /&gt;More important, by using a view, you can export data from multiple joined tables. The only thing you cannot do is specify the sequence in which the rows are written to the flat file, because a view does not let you include an ORDER BY clause in it unless you also use the TOP keyword.&lt;br /&gt;If you want to generate the data in a particular sequence or if you cannot predict the content of the data you want to export, be aware that in addition to a view, bcp also supports using an actual query. The only &quot;gotcha&quot; about using a query instead of a table or view is that you must specify queryout in place of out in the bcp command line.&lt;br /&gt;For example, you can use bcp to generate from the pubs database a list of authors who reside in California by writing the following code:&lt;br /&gt;bcp &quot;SELECT * FROM pubs..authors WHERE state = &#39;CA&#39;&quot; queryout c:\CAauthors.txt -c -T -S &lt;br /&gt;156.	What are the different ways of moving data/databases between servers and databases in SQL Server? &lt;br /&gt;There are lots of options available, you have to choose your option depending upon your requirements. Some of the options you have are: BACKUP/RESTORE, detaching and attaching databases, replication, DTS, BCP, logshipping, INSERT...SELECT, SELECT...INTO, creating INSERT scripts to generate data. &lt;br /&gt;157.	How will I export database?&lt;br /&gt;Through DTS - Import/Export wizard&lt;br /&gt;Backup - through Complete/Differential/Transaction Log &lt;br /&gt;158.	How to export database at a particular time, every week?&lt;br /&gt;Backup - Schedule&lt;br /&gt;DTS - Schedule&lt;br /&gt;Jobs - create a new job &lt;br /&gt;159.	How do you load large data to the SQL server database?&lt;br /&gt;bcp &lt;br /&gt;160.	How do you transfer data from text file to database (other than DTS)?&lt;br /&gt;bcp &lt;br /&gt;161.	What is OSQL and ISQL utility?&lt;br /&gt;The osql utility allows you to enter Transact-SQL statements, system procedures, and script files. This utility uses ODBC to communicate with the server. &lt;br /&gt;The isql utility allows you to enter Transact-SQL statements, system procedures, and script files; and uses DB-Library to communicate with Microsoft® SQL Server™ 2000.&lt;br /&gt;All DB-Library applications, such as isql, work as SQL Server 6.5–level clients when connected to SQL Server 2000. They do not support some SQL Server 2000 features.&lt;br /&gt;The osql utility is based on ODBC and does support all SQL Server 2000 features. Use osql to run scripts that isql cannot run. &lt;br /&gt;162.	What Tool you have used for checking Query Optimization? What is the use of profiler in sql server?  What is the first thing u look at in a SQL Profiler?&lt;br /&gt;SQL Profiler is a graphical tool that allows system administrators to monitor events in an instance of Microsoft® SQL Server™. You can capture and save data about each event to a file or SQL Server table to analyze later. For example, you can monitor a production environment to see which stored procedures is hampering performance by executing too slowly. &lt;br /&gt;Use SQL Profiler to: &lt;br /&gt;•	Monitor the performance of an instance of SQL Server. &lt;br /&gt;•	Debug Transact-SQL statements and stored procedures. &lt;br /&gt;•	Identify slow-executing queries. &lt;br /&gt;•	Test SQL statements and stored procedures in the development phase of a project by single-stepping through statements to confirm that the code works as expected. &lt;br /&gt;•	Troubleshoot problems in SQL Server by capturing events on a production system and replaying them on a test system. This is useful for testing or debugging purposes and allows users to continue using the production system without interference. &lt;br /&gt;Audit and review activity that occurred on an instance of SQL Server. This allows a security administrator to review any of the auditing events, including the success and failure of a login attempt and the success and failure of permissions in accessing statements and objects.&lt;br /&gt;&lt;br /&gt;Permissions &lt;br /&gt;163.	A user is a member of Public role and Sales role. Public role has the permission to select on all the table, and Sales role, which doesn’t have a select permission on some of the tables. Will that user be able to select from all tables?&lt;br /&gt;** &lt;br /&gt;164.	If a user does not have permission on a table, but he has permission to a view created on it, will he be able to view the data in table?&lt;br /&gt;Yes. &lt;br /&gt;165.	Describe Application Role and explain a scenario when you will use it?&lt;br /&gt;** &lt;br /&gt;166.	After removing a table from database, what other related objects have to be dropped explicitly?&lt;br /&gt;(view, SP) &lt;br /&gt;167.	You have a SP names YourSP and have the a Select Stmt inside the SP. You also have a user named YourUser. What permissions you will give him for accessing the SP.&lt;br /&gt;** &lt;br /&gt;168.	Different Authentication modes in Sql server? If a user is logged under windows authentication mode, how to find his userid?&lt;br /&gt;There are Three Different authentication modes in sqlserver. &lt;br /&gt;0.	Windows Authentication Mode &lt;br /&gt;1.	SqlServer Authentication Mode &lt;br /&gt;2.	Mixed Authentication Mode &lt;br /&gt;“system_user” system function in sqlserver to fetch the logged on user name. &lt;br /&gt;169.	Give the connection strings from front-end for both type logins(windows,sqlserver)?&lt;br /&gt;This are specifically for sqlserver not for any other RDBMS&lt;br /&gt;Data Source=MySQLServer;Initial Catalog=NORTHWIND;Integrated Security=SSPI (windows)&lt;br /&gt;Data Source=MySQLServer;Initial Catalog=NORTHWIND;Uid=” ”;Pwd=” ”(sqlserver) &lt;br /&gt;170.	What are three SQL keywords used to change or set someone’s permissions?&lt;br /&gt;Grant, Deny and Revoke&lt;br /&gt;&lt;br /&gt;Administration &lt;br /&gt;171.	Explain the architecture of SQL Server?&lt;br /&gt;** &lt;br /&gt;172.	Different types of Backups? &lt;br /&gt;o	A full database backup is a full copy of the database. &lt;br /&gt;o	A transaction log backup copies only the transaction log. &lt;br /&gt;o	A differential backup copies only the database pages modified after the last full database backup. &lt;br /&gt;o	A file or filegroup restore allows the recovery of just the portion of a database that was on the failed disk. &lt;br /&gt;173.	What are ‘jobs’ in SQL Server? How do we create one? What is tasks?&lt;br /&gt;Using SQL Server Agent jobs, you can automate administrative tasks and run them on a recurring basis.&lt;br /&gt;** &lt;br /&gt;174.	What is database replication? What are the different types of replication you can set up in SQL Server? How are they used? What is snapshot replication how is it different from Transactional replication?&lt;br /&gt;Replication is the process of copying/moving data between databases on the same or different servers. SQL Server supports the following types of replication scenarios: &lt;br /&gt;0.	Snapshot replication - It distributes data exactly as it appears at a specific moment in time and doesn’t monitor for updates. It can be used when data changes are infrequent. It is often used for browsing data such as price lists, online catalog, or data for decision support where the current data is not required and data is used as read only. &lt;br /&gt;1.	Transactional replication (with immediate updating subscribers, with queued updating subscribers) - With this an initial snapshot of data is applied, and whenever data modifications are made at the publisher, the individual transactions are captured and propagated to the subscribers. &lt;br /&gt;2.	Merge replication - It is the process of distributing the data between publisher and subscriber, it allows the publisher and subscriber to update the data while connected or disconnected, and then merging the updates between the sites when they are connected. &lt;br /&gt;175.	How can u look at what are the process running on SQL server? How can you kill a process in SQL server? &lt;br /&gt;o	Expand a server group, and then expand a server. &lt;br /&gt;o	Expand Management, and then expand Current Activity. &lt;br /&gt;o	Click Process Info. The current server activity is displayed in the details pane. &lt;br /&gt;In the details pane, right-click a Process ID, and then click Kill Process. &lt;br /&gt;176.	What is RAID and what are different types of RAID configurations? &lt;br /&gt;RAID stands for Redundant Array of Inexpensive Disks, used to provide fault tolerance to database servers. There are six RAID levels 0 through 5 offering different levels of performance, fault tolerance. &lt;br /&gt;177.	&lt;br /&gt;Some of the tools/ways that help you troubleshooting performance problems are: SET SHOWPLAN_ALL ON, SET SHOWPLAN_TEXT ON, SET STATISTICS IO ON, SQL Server Profiler, Windows NT /2000 Performance monitor, Graphical execution plan in Query Analyzer. &lt;br /&gt;178.	How to determine the service pack currently installed on SQL Server? &lt;br /&gt;The global variable @@Version stores the build number of the sqlservr.exe, which is used to determine the service pack installed.&lt;br /&gt;eg: Microsoft SQL Server 2000 - 8.00.760 (Intel X86) Dec 17 2002 14:22:05 Copyright (c) 1988-2003 Microsoft Corporation Enterprise Edition on Windows NT 5.0 (Build 2195: Service Pack 3) &lt;br /&gt;179.	What is the purpose of using COLLATE in a query?&lt;br /&gt;The term, collation, refers to a set of rules that determine how data is sorted and compared. In Microsoft® SQL Server 2000, it is not required to separately specify code page and sort order for character data, and the collation used for Unicode data. Instead, specify the collation name and sorting rules to use. Character data is sorted using rules that define the correct character sequence, with options for specifying case-sensitivity, accent marks, kana character types, and character width. Microsoft SQL Server 2000 collations include these groupings: &lt;br /&gt;•	Windows collations - Windows collations define rules for storing character data based on the rules defined for an associated Windows locale. The base Windows collation rules specify which alphabet or language is used when dictionary sorting is applied, as well as the code page used to store non-Unicode character data. For Windows collations, the nchar, nvarchar, and ntext data types have the same sorting behavior as char, varchar, and text data types &lt;br /&gt;•	SQL collations - SQL collations are provided for compatibility with sort orders in earlier versions of Microsoft SQL Server. &lt;br /&gt;Sort Order&lt;br /&gt;Binary is the fastest sorting order, and is case-sensitive. If Binary is selected, the Case-sensitive, Accent-sensitive, Kana-sensitive, and Width-sensitive options are not available. &lt;br /&gt;Sort order	Description&lt;br /&gt;Binary	Sorts and compares data in Microsoft® SQL Server™ tables based on the bit patterns defined for each character. Binary sort order is case-sensitive, that is lowercase precedes uppercase, and accent-sensitive. This is the fastest sorting order. &lt;br /&gt;If this option is not selected, SQL Server follows sorting and comparison rules as defined in dictionaries for the associated language or alphabet.&lt;br /&gt;Case-sensitive	Specifies that SQL Server distinguish between uppercase and lowercase letters. &lt;br /&gt;If not selected, SQL Server considers the uppercase and lowercase versions of letters to be equal. SQL Server does not define whether lowercase letters sort lower or higher in relation to uppercase letters when Case-sensitive is not selected.&lt;br /&gt;Accent-sensitive	Specifies that SQL Server distinguish between accented and unaccented characters. For example, &#39;a&#39; is not equal to &#39;á&#39;. &lt;br /&gt;If not selected, SQL Server considers the accented and unaccented versions of letters to be equal.&lt;br /&gt;Kana-sensitive	Specifies that SQL Server distinguish between the two types of Japanese kana characters: Hiragana and Katakana. &lt;br /&gt;If not selected, SQL Server considers Hiragana and Katakana characters to be equal.&lt;br /&gt;Width-sensitive	Specifies that SQL Server distinguish between a single-byte character (half-width) and the same character when represented as a double-byte character (full-width). &lt;br /&gt;If not selected, SQL Server considers the single-byte and double-byte representation of the same character to be equal. &lt;br /&gt;Windows collation options: &lt;br /&gt;•	Use Latin1_General for the U.S. English character set (code page 1252). &lt;br /&gt;•	Use Modern_Spanish for all variations of Spanish, which also use the same character set as U.S. English (code page 1252). &lt;br /&gt;•	Use Arabic for all variations of Arabic, which use the Arabic character set (code page 1256). &lt;br /&gt;•	Use Japanese_Unicode for the Unicode version of Japanese (code page 932), which has a different sort order from Japanese, but the same code page (932). &lt;br /&gt;180.	What is the STUFF Function and how does it differ from the REPLACE function?&lt;br /&gt;STUFF - Deletes a specified length of characters and inserts another set of characters at a specified starting point. &lt;br /&gt;SELECT STUFF(&#39;abcdef&#39;, 2, 3, &#39;ijklmn&#39;)&lt;br /&gt;GO&lt;br /&gt;Here is the result set:&lt;br /&gt;--------- &lt;br /&gt;aijklmnef &lt;br /&gt;REPLACE - Replaces all occurrences of the second given string expression in the first string expression with a third expression.&lt;br /&gt;SELECT REPLACE(&#39;abcdefghicde&#39;,&#39;cde&#39;,&#39;xxx&#39;)&lt;br /&gt;GO &lt;br /&gt;Here is the result set: &lt;br /&gt;------------&lt;br /&gt;abxxxfghixxx &lt;br /&gt;181.	What does it mean to have quoted_identifier on? What are the implications of having it off?&lt;br /&gt;When SET QUOTED_IDENTIFIER is OFF (default), literal strings in expressions can be delimited by single or double quotation marks.&lt;br /&gt;When SET QUOTED_IDENTIFIER is ON, all strings delimited by double quotation marks are interpreted as object identifiers. Therefore, quoted identifiers do not have to follow the Transact-SQL rules for identifiers. &lt;br /&gt;SET QUOTED_IDENTIFIER must be ON when creating or manipulating indexes on computed columns or indexed views. If SET QUOTED_IDENTIFIER is OFF, CREATE, UPDATE, INSERT, and DELETE statements on tables with indexes on computed columns or indexed views will fail. &lt;br /&gt;The SQL Server ODBC driver and Microsoft OLE DB Provider for SQL Server automatically set QUOTED_IDENTIFIER to ON when connecting.&lt;br /&gt;When a stored procedure is created, the SET QUOTED_IDENTIFIER and SET ANSI_NULLS settings are captured and used for subsequent invocations of that stored procedure. When executed inside a stored procedure, the setting of SET QUOTED_IDENTIFIER is not changed.&lt;br /&gt;SET QUOTED_IDENTIFIER OFF&lt;br /&gt;GO&lt;br /&gt;-- Attempt to create a table with a reserved keyword as a name&lt;br /&gt;-- should fail.&lt;br /&gt;CREATE TABLE &quot;select&quot; (&quot;identity&quot; int IDENTITY, &quot;order&quot; int)&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;SET QUOTED_IDENTIFIER ON&lt;br /&gt;GO&lt;br /&gt;-- Will succeed.&lt;br /&gt;CREATE TABLE &quot;select&quot; (&quot;identity&quot; int IDENTITY, &quot;order&quot; int)&lt;br /&gt;GO &lt;br /&gt;182.	What is the purpose of UPDATE STATISTICS?&lt;br /&gt;Updates information about the distribution of key values for one or more statistics groups (collections) in the specified table or indexed view. &lt;br /&gt;183.	Fundamentals of Data warehousing &amp; olap? &lt;br /&gt;184.	What do u mean by OLAP server? What is the difference between OLAP and OLTP? &lt;br /&gt;185.	What is a tuple?&lt;br /&gt;A tuple is an instance of data within a relational database. &lt;br /&gt;186.	Services and user Accounts maintenance &lt;br /&gt;187.	sp_configure commands?&lt;br /&gt;Displays or changes global configuration settings for the current server. &lt;br /&gt;188.	What is the basic functions for master, msdb, tempdb databases?&lt;br /&gt;Microsoft® SQL Server 2000 systems have four system databases: &lt;br /&gt;•	master - The master database records all of the system level information for a SQL Server system. It records all login accounts and all system configuration settings. master is the database that records the existence of all other databases, including the location of the database files. &lt;br /&gt;•	tempdb - tempdb holds all temporary tables and temporary stored procedures. It also fills any other temporary storage needs such as work tables generated by SQL Server. tempdb is re-created every time SQL Server is started so the system starts with a clean copy of the database. &lt;br /&gt;By default, tempdb autogrows as needed while SQL Server is running. If the size defined for tempdb is small, part of your system processing load may be taken up with autogrowing tempdb to the size needed to support your workload each time to restart SQL Server. You can avoid this overhead by using ALTER DATABASE to increase the size of tempdb. &lt;br /&gt;•	model - The model database is used as the template for all databases created on a system. When a CREATE DATABASE statement is issued, the first part of the database is created by copying in the contents of the model database, then the remainder of the new database is filled with empty pages. Because tempdb is created every time SQL Server is started, the model database must always exist on a SQL Server system. &lt;br /&gt;•	msdb - The msdb database is used by SQL Server Agent for scheduling alerts and jobs, and recording operators. &lt;br /&gt;189.	What are sequence diagrams? What you will get out of this sequence diagrams?&lt;br /&gt;Sequence diagrams document the interactions between classes to achieve a result, such as a use case. Because UML is designed for object-oriented programming, these communications between classes are known as messages. The sequence diagram lists objects horizontally, and time vertically, and models these messages over time. &lt;br /&gt;190.	What are the new features of SQL 2000 than SQL 7? What are the new datatypes in sql? &lt;br /&gt;•	XML Support - The relational database engine can return data as Extensible Markup Language (XML) documents. Additionally, XML can also be used to insert, update, and delete values in the database. (for xml raw - to retrieve output as xml type) &lt;br /&gt;•	User-Defined Functions - The programmability of Transact-SQL can be extended by creating your own Transact-SQL functions. A user-defined function can return either a scalar value or a table. &lt;br /&gt;•	Indexed Views - Indexed views can significantly improve the performance of an application where queries frequently perform certain joins or aggregations. An indexed view allows indexes to be created on views, where the result set of the view is stored and indexed in the database. &lt;br /&gt;•	New Data Types - SQL Server 2000 introduces three new data types. bigint is an 8-byte integer type. sql_variant is a type that allows the storage of data values of different data types. table is a type that allows applications to store results temporarily for later use. It is supported for variables, and as the return type for user-defined functions. &lt;br /&gt;•	INSTEAD OF and AFTER Triggers - INSTEAD OF triggers are executed instead of the triggering action (for example, INSERT, UPDATE, DELETE). They can also be defined on views, in which case they greatly extend the types of updates a view can support. AFTER triggers fire after the triggering action. SQL Server 2000 introduces the ability to specify which AFTER triggers fire first and last. &lt;br /&gt;•	Multiple Instances of SQL Server - SQL Server 2000 supports running multiple instances of the relational database engine on the same computer. Each computer can run one instance of the relational database engine from SQL Server version 6.5 or 7.0, along with one or more instances of the database engine from SQL Server 2000. Each instance has its own set of system and user databases. &lt;br /&gt;•	Index Enhancements - You can now create indexes on computed columns. You can specify whether indexes are built in ascending or descending order, and if the database engine should use parallel scanning and sorting during index creation. &lt;br /&gt;191.	How do we open SQL Server in single user mode?&lt;br /&gt;We can accomplish this in any of the three ways given below :- &lt;br /&gt; .	From Command Prompt :-&lt;br /&gt;sqlservr -m &lt;br /&gt;a.	From Startup Options :-&lt;br /&gt;Go to SQL Server Properties by right-clicking on the Server name in the Enterprise manager. &lt;br /&gt;Under the &#39;General&#39; tab, click on &#39;Startup Parameters&#39;. &lt;br /&gt;Enter a value of -m in the Parameter. &lt;br /&gt;b.	From Registry :-&lt;br /&gt;Go to HKEY_LOCAL_MACHINE\Software\Microsoft\MSSQLServer\MSSQLServer\Parameters. &lt;br /&gt;Add new string value. &lt;br /&gt;Specify the &#39;Name&#39; as SQLArg(n) &amp; &#39;Data&#39; as -m. &lt;br /&gt;Where n is the argument number in the list of arguments. &lt;br /&gt;192.	Difference between clustering and NLB (Network Load Balancing)?&lt;br /&gt;** &lt;br /&gt;193.	Explain Active/Active and Active/Passive cluster configurations?&lt;br /&gt;** &lt;br /&gt;194.	What is Log Shipping?&lt;br /&gt;In Microsoft® SQL Server™ 2000 Enterprise Edition, you can use log shipping to feed transaction logs from one database to another on a constant basis. Continually backing up the transaction logs from a source database and then copying and restoring the logs to a destination database keeps the destination database synchronized with the source database. This allows you to have a backup server and also provides a way to offload query processing from the main computer (the source server) to read-only destination servers. &lt;br /&gt;195.	What are the main steps you take care for enhancing SQL Server performance?&lt;br /&gt;** &lt;br /&gt;196.	You have to check whether any users are connected to sql server database and if any user is connected to database, you have to disconnect the user(s) and run a process in a job. How do you do the above in a job?&lt;br /&gt;**&lt;br /&gt;&lt;br /&gt;XML &lt;br /&gt;197.	How can I convert data in a Microsoft Access table into XML format?&lt;br /&gt;The following applications can help you convert Access data into XML format: Access 2002, ADO 2.5, and SQLXML. Access 2002 (part of Microsoft Office XP) enables you to query or save a table in XML format. You might be able to automate this process. ADO 2.5 and later enables you to open the data into a recordset, then persist the recordset in XML format, as the following code shows:&lt;br /&gt;rs.Save &quot;c:\rs.xml&quot;, adPersistXML&lt;br /&gt;You can use linked servers to add the Access database to your SQL Server 2000 database so you can run queries from within SQL Server to retrieve data. Then, through HTTP, you can use the SQLXML technology to extract the Access data in the XML format you want.&lt;br /&gt;&lt;br /&gt;NEW&lt;br /&gt;198.	@@IDENTITY ?&lt;br /&gt;Ans: Returns the last-inserted identity value. &lt;br /&gt;199.	If a job is fail in sql server, how do find what went wrong? &lt;br /&gt;200.	Have you used Error handling in DTS? &lt;br /&gt;&lt;br /&gt;</content><link rel="related" href=".NET FRAMEWORK , SQL C# Questions" title=".NET FRAMEWORK , SQL C# Questions"/><link rel='replies' type='application/atom+xml' href='http://gudurin.blogspot.com/feeds/1367915440072983443/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1819512445879631740/1367915440072983443' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1819512445879631740/posts/default/1367915440072983443'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1819512445879631740/posts/default/1367915440072983443'/><link rel='alternate' type='text/html' href='http://gudurin.blogspot.com/2009/09/net-framework-sql-c-questions.html' title='.NET FRAMEWORK , SQL C# Questions'/><author><name>Naresh Guduri Blog</name><uri>http://www.blogger.com/profile/02461913656830998473</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1819512445879631740.post-5205088341638625171</id><published>2009-09-17T18:10:00.001-07:00</published><updated>2009-09-17T18:10:45.108-07:00</updated><title type='text'>Ramayan retold by NRI</title><content type='html'>&lt;span style=&quot;font-weight:bold;&quot;&gt;&lt;/span&gt;&lt;br /&gt;A young second generation Indian in the US was asked by his mother to explain the significance of &quot;Diwali&quot; to his younger brother.&lt;br /&gt;&lt;br /&gt;The mother fainted after hearing the new Ramayana. The Docs asked the reason and she told &quot;This is how he went about it...&lt;br /&gt;So, like this dude had, like, a big cool kingdom and people liked him. But, like, his step-mom, or something, was kind of a bitch, and she forced her husband to, like, send this cool-dude, he was Ram, to some national forest or something.... Since he was going, for like, something like more than 10 years or so.... he decided to get his wife and his bro along.... you know...so that they could all chill out together. &lt;br /&gt;&lt;br /&gt;But Dude, the forest was reeeeal scary shit... really man...they had monkeys and devils and shit like that. But this dude, Ram, kicked with darts and bows and arrows... so it was fine.&lt;br /&gt;But then some bad gangsta boys, some jerk called Ravan, picks up his babe (Sita) and lures her away to his hood. And boy was our man, and also his bro, Laxman, pissed... all the gods were with him... So anyways, you don&#39;t mess with gods. So, Ram, and his bro get an army of monkeys... Dude, don&#39;t ask me how they trained the damn monkeys... just go along with me, ok...&lt;br /&gt;So, Ram, Lax and their monkeys whip this gangsta&#39;s ass in his own hood.... Anyways, by this time, their time&#39;s up in the forest... and anyways... it gets kinda boring, you know... no TV or malls or shit like that. So, they decided to hitch a ride back home... and when the people realize that our dude, his bro and the wife are back home... they thought, well, you know, at least they deserve something nice... and they didn&#39;t have any bars or clubs in those days... so they couldn&#39;t take them out for a drink, so they, like, decided to smoke and stuff ... and since they also had some lamps, they lit the lamps also...so it was pretty cooool... you know with all those fireworks.... Really, they even had some local band play along with the fireworks... and you know, what, dude, that was the very first, no kidding.., that was the very first music-synchronized fireworks.... you know, like the 4th of July stuff, but just, more cooler and stuff, you know. &lt;br /&gt;&lt;br /&gt;And, so dude, that was how, like, this festival started.</content><link rel='replies' type='application/atom+xml' href='http://gudurin.blogspot.com/feeds/5205088341638625171/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1819512445879631740/5205088341638625171' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1819512445879631740/posts/default/5205088341638625171'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1819512445879631740/posts/default/5205088341638625171'/><link rel='alternate' type='text/html' href='http://gudurin.blogspot.com/2009/09/ramayan-retold-by-nri.html' title='Ramayan retold by NRI'/><author><name>Naresh Guduri Blog</name><uri>http://www.blogger.com/profile/02461913656830998473</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1819512445879631740.post-6661126636544992215</id><published>2009-09-16T07:06:00.000-07:00</published><updated>2009-09-16T07:07:10.365-07:00</updated><title type='text'>How guys select the girl</title><content type='html'>How guys select the girl &lt;br /&gt;&lt;br /&gt;How guys select the girl they want to marry&lt;br /&gt;&lt;br /&gt;A man is dating three women and wants to decide which to marry.&lt;br /&gt;He decides to give them a test. He gives each woman a present of $5,000 and watches to see what they do with the money.&lt;br /&gt;The first does a total makeover. She goes to a fancy beauty salon, gets her hair done, purchases new make-up and buys several new outfits, and dresses up very nicely for the man.&lt;br /&gt;She tells him that she has done this to be more attractive for him because she loves him so much.&lt;br /&gt;The man is impressed.&lt;br /&gt;&lt;br /&gt;The second goes shopping to buy the man gifts.&lt;br /&gt;She gets him a new set of STRONG golf clubs, some new gizmos for his computer, and some expensive clothes.As she presents these gifts, she tells him that she has spent all the money on him because she loves him so much.&lt;br /&gt;Again, the man is impressed.&lt;br /&gt;The third invests the money in the stock market.&lt;br /&gt;She earns several times the $5,000. She gives him back his $5000 and reinvests the remainder in a joint account.&lt;br /&gt;She tells him that she wants to save for their future because she loves him so much.&lt;br /&gt;Obviously, the man was impressed.&lt;br /&gt;The man thought for a long time about what each woman had done with the money.&lt;br /&gt;Guess which lady he chose to marry?&lt;br /&gt;Think like a man . . .&lt;br /&gt;(scroll down for the answer)&lt;br /&gt;*&lt;br /&gt;*&lt;br /&gt;*&lt;br /&gt;*&lt;br /&gt;*&lt;br /&gt;*&lt;br /&gt;*&lt;br /&gt;*&lt;br /&gt;*&lt;br /&gt;*&lt;br /&gt;*&lt;br /&gt;*&lt;br /&gt;*&lt;br /&gt;*&lt;br /&gt;*&lt;br /&gt;*&lt;br /&gt;*&lt;br /&gt;*&lt;br /&gt;*&lt;br /&gt;*&lt;br /&gt;*&lt;br /&gt;He married the most beautiful one!!!!!!&lt;br /&gt;Men are Men.... Obviously!!!</content><link rel='replies' type='application/atom+xml' href='http://gudurin.blogspot.com/feeds/6661126636544992215/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1819512445879631740/6661126636544992215' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1819512445879631740/posts/default/6661126636544992215'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1819512445879631740/posts/default/6661126636544992215'/><link rel='alternate' type='text/html' href='http://gudurin.blogspot.com/2009/09/how-guys-select-girl.html' title='How guys select the girl'/><author><name>Naresh Guduri Blog</name><uri>http://www.blogger.com/profile/02461913656830998473</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1819512445879631740.post-4125961783891076792</id><published>2009-09-07T19:41:00.000-07:00</published><updated>2009-09-07T19:42:42.608-07:00</updated><title type='text'>142 jokes exclusive</title><content type='html'>JOKES &lt;br /&gt;&lt;br /&gt;1 A Teacher lecturing on population - In India after Every 10 sec a woman gives birth to a kid. &lt;br /&gt;A Sardar stands up- we must find &amp; stop her!. &lt;br /&gt;&lt;br /&gt;2 Sardar-why r all these people running? &lt;br /&gt;Man- This is a race, the winner will get the cup. &lt;br /&gt;Sardar-If only the winner will get the cup, why r others running? &lt;br /&gt;&lt;br /&gt;3 Teacher: &quot;I killed a person&quot; convert this sentence Into future tense. &lt;br /&gt;Sardar: The future tense is &quot;u will go to jail&quot;. &lt;br /&gt;&lt;br /&gt;4 Sardarji was filling up application form for a job. He was not sure as to what to be filled in column &quot;Salary Expected&quot;. &lt;br /&gt;After much thought he wrote: Yes! &lt;br /&gt;&lt;br /&gt;5 Sardar told his servant: Go and water the plants. Servant &lt;br /&gt;it’s already raining. Sardar: So what? Take an umbrella and go. &lt;br /&gt;&lt;br /&gt;6 Sardar wins 20 cr from Rs. 20 lottery ticket. Dealer gave 11cr after &lt;br /&gt;deducting tax. Angry Sardar: &quot;Give me 20 cr or else return my 20 Rs back. &lt;br /&gt;&lt;br /&gt;7 Postman:- I Have To Come 5 Miles To Deliver U This Packet &lt;br /&gt;Sardar:- why did u come so far. Instead u could have posted it.... &lt;br /&gt;&lt;br /&gt;8 Sardar&#39;s wish :when i die,i wana die like my grandpa who died peacefully in his sleep not screaming like all the passengers in the car he was driving.. &lt;br /&gt;&lt;br /&gt;9 Sardar at an Art Gallery: I suppose this horrible looking thing is what you call modern art ? &lt;br /&gt;Art dealer: I beg your pardon sir, thats a mirror! &lt;br /&gt;&lt;br /&gt;10 Sardar was writing something very slowly. &lt;br /&gt;Friend asked:&quot; Why r u writing so slowly? &lt;br /&gt;Sardar: &quot;I&#39;m writing to my 6 yr old son, he can&#39;t read very fast. &lt;br /&gt;&lt;br /&gt;11 Flash news: A 2 seater plane crashed in a graveyard in punjab . Local sardars have so far found 500 bodies and are still digging for more.. &lt;br /&gt;&lt;br /&gt;12 A man asked sardarji, why Manmohan singh goes walking at evening not &lt;br /&gt;in the morning. Sardarji replied &quot;Arey bhai Manmohan is PM not AM&quot;. &lt;br /&gt;&lt;br /&gt;13 Wife: You always carry my photo in your handbag to the office. Why? &lt;br /&gt;Darling : When there is a problem, no matter how impossible, I look at your picture and the problem disappears. &lt;br /&gt;Wife: You see, how miraculous and powerful I am for you? &lt;br /&gt;Darling : Yes, I see your picture and say to myself, &quot;What other problem Can there be greater than this one? &lt;br /&gt;&lt;br /&gt;14 Girl: When we get married, I want to share all your worries, troubles and lighten your burden. &lt;br /&gt;Boy: It&#39;s very kind of you, darling, But I don&#39;t have any worries or troubles. &lt;br /&gt;Girl: Well that is because we aren&#39;t married yet. &lt;br /&gt;&lt;br /&gt;15 Son: Mom, when I was on the bus with Dad this morning, he told me to &lt;br /&gt;give up my seat to a lady. &lt;br /&gt;Mom: Well, you have done the right thing. &lt;br /&gt;Son: But mom, I was sitting on daddy&#39;s lap. &lt;br /&gt;&lt;br /&gt;16 A newly married man asked his wife, &quot;Would you have married me if &lt;br /&gt;my father hadn&#39;t left me a fortune?&quot; &quot;Honey,&quot; the woman replied Sweetly, &lt;br /&gt;&quot;I&#39;d have married you NO MATTER WHO LEFT YOU A FORTUNE&quot; &lt;br /&gt;&lt;br /&gt;17 Father to son after exam: &quot;let me see your report card.&quot; &lt;br /&gt;Son: &quot;My friend just borrowed it. He wants to scare his parents.&quot; &lt;br /&gt;&lt;br /&gt;18 A teacher asked her class for sentences using the word &quot;beans&quot;.. &lt;br /&gt;My Father grows beans,&quot; said one student. &quot;My father cooks beans,&quot; said &lt;br /&gt;another. &lt;br /&gt;Then little Johnny spoke up: &quot;We are all human beans.&quot; &lt;br /&gt;&lt;br /&gt;19 Interviewer to Millionaire: To whom do you owe your success as a millionaire?&quot; &lt;br /&gt;Millionaire: &quot;I owe everything to my wife.&quot; &lt;br /&gt;Interviewer: &quot;Wow, she must be some woman. &lt;br /&gt;Interviewer: &quot;What were you before you married her?&quot; &lt;br /&gt;Millionaire: &quot;A Billionaire&quot; &lt;br /&gt;&lt;br /&gt;20 Its funny when people discuss over &quot;love marriage&quot; and &quot;arranged marriage&quot; &lt;br /&gt;It is like asking a person if he would like to &quot;hang himself&quot; or &quot;shoot himself&quot;. &lt;br /&gt;&lt;br /&gt;21 What is a girl friend? &lt;br /&gt;Addition of problems, subtraction of money, multiplication of enemies &amp; division of friends. &lt;br /&gt;&lt;br /&gt;22 Guide: &quot;I welcome you all to Niagara Falls. These are the world&#39;s largest &lt;br /&gt;waterfalls and the sound intensity of the waterfall is so high, even 20 &lt;br /&gt;supersonic planes passing by can&#39;t be heard. &lt;br /&gt;Now may I request the ladies to keep quite so that we can hear the Niagara &lt;br /&gt;Falls?&quot; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;23 Three patients in a mental institution prepare for an examination given by the head psychiatrist. &lt;br /&gt;If the patients pass the exam, they will be free to leave the hospital. However, if they fail, the institution will detain them for seven years. &lt;br /&gt;The doctor takes the three patients to the top of a diving board overlooking an empty swimming pool, and asks the first patient to jump. &lt;br /&gt;The first patient jumps head first into the pool and breaks both arms. &lt;br /&gt;Then the second patient jumps and breaks both legs. &lt;br /&gt;The third patient looks over the side and refuses to jump. &lt;br /&gt;&quot;Congratulations! You&#39;re a free man. Just tell me why didn&#39;t you jump?&quot; asked the doctor. &lt;br /&gt;To which the third patient answered, &quot;Well Doc, I can&#39;t swim!&quot; &lt;br /&gt;&lt;br /&gt;24 As a old man was driving down the freeway, his car phone rang. &lt;br /&gt;Answering, he heard his wife&#39;s voice urgently warning him, &lt;br /&gt;&quot;Herman, I just heard on the news that there&#39;s a car going the wrong way on Route 280. Please be careful!&quot; &lt;br /&gt;&quot;It&#39;s not just one car,&quot; said Herman, &quot;It&#39;s hundreds of them!&quot; &lt;br /&gt;&lt;br /&gt;25 Why do men chase women they have no intention of marrying? &lt;br /&gt;For the same reason dogs chase cars they have no intention of driving. &lt;br /&gt;&lt;br /&gt;28 How do you recognize a Sardar in School? &lt;br /&gt;He is the one who erases the notes from the book when the teacher erases the board. &lt;br /&gt;&lt;br /&gt;29 once a Sardhar was walking and had a glove on one hand and not on other so the man asked him why did he do so. He Replied that the weather forecast announced that on one hand it would be cold and on the other hand it would be hot. &lt;br /&gt;&lt;br /&gt;30 Sardarji bought a brand new Maruti and decided to drive down from Amritsar, where he lived, to Jalandar to meet his friend. He reached there in a few hours. &lt;br /&gt;After spending a few days there, he decided to return, and called up his mother to expect him in the evening. But he didn&#39;t reach in the evening and not the next day either. &quot;&lt;br /&gt;When he finally reached home on the third day, his distraught mother ran and asked him &quot; Arre Puttar, ki hoya? &lt;br /&gt;(What Happened, My Son?) &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;31 The Sardarji got out, obviously very tired from a long journey, and said, &quot;Oy, ye Marutti wale pagal hain, agge jaane waaste chaar gear banaate hain, ) &lt;br /&gt;aur pichche jaane waaste sirf ik?&quot; (These Maruti Car people are crazy! They have four gears for going forward, but only one for going back! &lt;br /&gt;&lt;br /&gt;32 Santa Singh decided to start a chicken farm so he bought a hundred chickens to begin with. A month later he returned to the dealer for another hundred chickens . &lt;br /&gt;because all of the first lot had died. A month later he was back at t he dealer for another hundred chickens for the second lot had also died &lt;br /&gt;&#39;But I think I know where I&#39;m going wrong,&#39; said Santa, &#39;I think I&#39;m planting them too deep.&#39; &lt;br /&gt;&lt;br /&gt;33 2 Dost Suicide karne gae, Pahala : &quot;Hey Bhagwan muje dunia ki saari &lt;br /&gt;nafrat de Pareshani de Duk de!&quot; Dusra dost : &quot;Abe tu maut maang raha &lt;br /&gt;hai ki Reliance mai Job. &lt;br /&gt;&lt;br /&gt;34 Q - What is the Difference Between Mother &amp; Wife ? &lt;br /&gt;A - One Woman Brings U into this world crying... &amp; the other &lt;br /&gt;ensures U &lt;br /&gt;Continue to do so. &lt;br /&gt;&lt;br /&gt;35 Sardar to Shopkeeper: - Mujhe India Ka Flag Dikhao, Shopkeeper ne &lt;br /&gt;Flag &lt;br /&gt;Dikhaya, Sardar: - Isme aur Colour Dikhao. &lt;br /&gt;&lt;br /&gt;36 .How can a Sardar Kill a Lion ? Sardarji thinks N thinks hard &amp; &lt;br /&gt;comes to a conclusion: I&#39;ll drink poison n let lion eat me. O&#39; bolo &lt;br /&gt;ta ra ra. &lt;br /&gt;&lt;br /&gt;37 A Chinese pair accidentally had twins without getting married, Guess &lt;br /&gt;what they named them... Jo Hua, So Hua. &lt;br /&gt;&lt;br /&gt;38 Wife : Honey ...... What are You Looking for ? &lt;br /&gt;Husband : Nothing. &lt;br /&gt;Wife : Nothing...?? U&#39;ve been reading our marriage certificate 4 an &lt;br /&gt;hour ...?? Husband : I was just looking 4 the expiry date. &lt;br /&gt;&lt;br /&gt;39 Papa : beta har parai stri ko apni Maa samjho to tumhara character &lt;br /&gt;thik ho jaaega.....Beta : Lekin Papa fir Aap ke character ka kya &lt;br /&gt;hoga....??? &lt;br /&gt;&lt;br /&gt;40 Sardar: O Banno Car ki speed itani ky badha di..? biwi: Oji Car ki &lt;br /&gt;break &lt;br /&gt;fail ho gayi hai, Exident ho jaye iske pahale ghar pahunch jaate hai. &lt;br /&gt;&lt;br /&gt;41 Sardar : Sitting on The Top of the Mountain and Studying.... When a &lt;br /&gt;Person asked what he was doing.... He replied... Oye!! Higher &lt;br /&gt;Studies &lt;br /&gt;Yaar...!!! &lt;br /&gt;&lt;br /&gt;42 Mayawati came to Lalu&#39;s House with a Goat..... &lt;br /&gt;Lalu : Bhaiswa ko kyun Layi ho....?? &lt;br /&gt;Maya : Dikhta nahi, Goatwa hai..?? &lt;br /&gt;Lalu : Hum Goatwa se hi Puch raha Hun..!! &lt;br /&gt;52 &lt;br /&gt;43 Wife : Do you want dinner? &lt;br /&gt;Husband : Sure, what are my choices? &lt;br /&gt;Wife : Yes and no. &lt;br /&gt;&lt;br /&gt;44 Man : How old is your father? &lt;br /&gt;Boy : As old as me. &lt;br /&gt;Man : How can that be? &lt;br /&gt;Boy : He became a father only when I was born &lt;br /&gt;&lt;br /&gt;45 Teacher : Correct the sentence, &quot;A bull and a cow is grazing in the &lt;br /&gt;field&quot; &lt;br /&gt;Student : A cow and a bull is grazing in the field &lt;br /&gt;Teacher : How? &lt;br /&gt;Student : Ladies first. &lt;br /&gt;&lt;br /&gt;46 Customer: If I post this letter tonight, will it get to Delhi in two days time? &lt;br /&gt;Post Master : Yes sir, it definitely will. &lt;br /&gt;Customer : I bet you, it won&#39;t. &lt;br /&gt;Post Master : Why not? &lt;br /&gt;Customer : It&#39;s addressed to Mumbai. &lt;br /&gt;&lt;br /&gt;47 1st thief : Oh ! The police is here. Quick! Jump out of the window! &lt;br /&gt;2nd thief : But this is the 13th floor. &lt;br /&gt;1st thief : Hurry! this is no time for superstitions &lt;br /&gt;&lt;br /&gt;48 Man before Marriage I like Airtel....”Aisi Azaadi Aur Kahaan” &lt;br /&gt;After Marriage He&#39;s Like Hutch... &quot; Where R U Go Our Network &lt;br /&gt;Follows.&quot; &lt;br /&gt;&lt;br /&gt;49 Santa : That Cow is a Lovely Colour , &lt;br /&gt;Farmer : Yes, it&#39;s a Jersey. &lt;br /&gt;Santa : Oh, I Thought it was its Skin...!!! &lt;br /&gt;gaya... aur main...SWARGWASI. .. &lt;br /&gt;&lt;br /&gt;50 They say that when a man holds a woman&#39;s hand before marriage, it is &lt;br /&gt;love; after marriage it is self-defense &lt;br /&gt;&lt;br /&gt;51 It is difficult to understand GOD. He makes such beautiful things as &lt;br /&gt;women..and then he turns them into Wives !?!!!?! &lt;br /&gt;&lt;br /&gt;52 It takes thousand workers to build a castle , Million soldiers to &lt;br /&gt;protect a country &lt;br /&gt;BUT Just ONE woman to make a Happy HOME! Let&#39;s Thank ......KAAMWALI &lt;br /&gt;&lt;br /&gt;53 After Finishing MBBS, Dr. Munna Starts his practice. He Chcked 1st &lt;br /&gt;patient eyes, tongue &amp; ears by Torch &lt;br /&gt;&amp; finally said BOLE TO.......... TORCH THEEEEK HAI &lt;br /&gt;&lt;br /&gt;54 What is the difference between a woman and a magnet? Magnets have a &lt;br /&gt;positive side! &lt;br /&gt;&lt;br /&gt;55 Ladka: Janeman is dil mein aaja. &lt;br /&gt;Ladki: Sandal nikalu kya? &lt;br /&gt;Ladka: Pagli mandir thodi hi hai, aise hi aaja!! &lt;br /&gt;&lt;br /&gt;56 It&#39;s funny when people discuss LOVE MARRIAGE vs ARRANGED. &lt;br /&gt;It&#39;s like asking someone, if suicide is better or being murdered &lt;br /&gt;&lt;br /&gt;57 A person who surrenders when he&#39;s WRONG, is HONEST. &lt;br /&gt;A person who SURRENDERS when not SURE, is WISE.. &lt;br /&gt;A person who surrenders even if he&#39;s RIGHT, is a HUSBAND.! &lt;br /&gt;&lt;br /&gt;58 Mayawati came to Lallu&#39;s house with a goat. &lt;br /&gt;Lallu: Bhaiswa ko kyon layi ho? &lt;br /&gt;Maya: Dikhta nahin goatwa hai? &lt;br /&gt;Lallu: Hum goatwa se hi to pooch raha hoon. &lt;br /&gt;&lt;br /&gt;59 Do sardar jee motor cycle per bomb lay kar jarahay thay, &lt;br /&gt;Rastay main speed breaker ki waja say jhatkay lag rahay thay, &lt;br /&gt;&lt;br /&gt;Sardar jee ka dost bola yaar aaram say gari chalao kahi bomb na &lt;br /&gt;phatjain, &lt;br /&gt;Sardar jee...Oo tussi fiker hi naker assi kay pass dosra bhi tu bomb &lt;br /&gt;hay.  &lt;br /&gt;&lt;br /&gt;60 aik sharabi raatkay waqat apnay dost kay sath jaraha hota hay. rastay &lt;br /&gt;main talab per nazar parhti hay tu us main us ko chand dikhta hay woh &lt;br /&gt;apny dost say &lt;br /&gt;kahta hay yaar ye kia hay.dost kehta hay chand hay. sharabi hairan ho &lt;br /&gt;ker &lt;br /&gt;yaar hum log itnay upper aagaiy &lt;br /&gt;&lt;br /&gt;61 Santa Singh goes to a TV shop and asks, &#39;Aap ke paas color TV hai &lt;br /&gt;kya?&#39; &lt;br /&gt;&#39;Haan&#39; replies shopowner. Santa Singh says, &#39;Ek hara vala dena!&#39; &lt;br /&gt;&lt;br /&gt;62 A sardar calls another sardar on the phone &amp; says &quot;Hi, Main Bol Raha &lt;br /&gt;Hoon&quot;. &lt;br /&gt;The other sardar replies &quot;Kamaal Hain,Ithe bhi Main Bol Raha Hoon!&quot; &lt;br /&gt;&lt;br /&gt;63 Ek pathan Cycle chalaty aur gungunaty howe kahin ja raha tha rasty &lt;br /&gt;mein ek Aurat se takra betha. &lt;br /&gt;Aurat chilla kar boli &quot;Break nahi maar sakty thy kia ??? &quot; &lt;br /&gt;Pathan herat se... &quot;Pora cycle mar deya abhi break mar kar kia faida.&quot; &lt;br /&gt;&lt;br /&gt;64 Burhiya:Aray dekho iss kambakhat maare ko mere sath larki ja rahi he &lt;br /&gt;osse nahi dekh raha kab se mujhe taare chala ja ria he...! &lt;br /&gt;&lt;br /&gt;65 Aadmi:Aray.. ! amma darasal ye kabaria he purana maal dekh raha he. &lt;br /&gt;&lt;br /&gt;66 Ustaad: Bete, aap jab hanste hen to aap ke dimples parte hen aap bohat &lt;br /&gt;ache lagte hen dil chahta he aap ko piyar karloon. &lt;br /&gt;&lt;br /&gt;67 Bacha: Sir, mujhse ziyada dimple to mere ammi ke parte hen. &lt;br /&gt;&lt;br /&gt;68 &lt;o&gt;Aik lerki apny boy friend k sath nai garri main long drive par &lt;br /&gt;ja rahi thi &lt;br /&gt;achanak larki kehnay lagi.....suno ! &lt;br /&gt;kia tum aik haath se garri chala saktay ho ? &lt;br /&gt;kioon nahi.....larkay ne bare fakher se garden akraaii... &lt;br /&gt;larki ne aahista se kaha........ .. &lt;br /&gt;&quot;to phir doosray haath se apni naak saaf kar lo &quot; &lt;br /&gt;&lt;br /&gt;69 Sardar : Apne bete se bola, Bevakuf...kaisa machis leke aaya hai, ek &lt;br /&gt;bhi tili nahin jalti. &lt;br /&gt;Beta : Kya baat karte ho papa, sab tili test karke laya hu. &lt;br /&gt;&lt;br /&gt;70 Doctor : App ka aur aapki biwi ka blood group ek hi hai? &lt;br /&gt;Sardaar : Hoga, Jarur hoga; 25 saalse mera khoon jo pee rahi hai.... &lt;br /&gt;&lt;br /&gt;71 Nurse - &quot;Mubarak ho.. Sardarji.. aap papa ban gaye..&quot; &lt;br /&gt;Sardarji - &quot; Meri wife ko nahi bolna.. main usey SURPRISE doonga..!&quot; &lt;br /&gt;&lt;br /&gt;72 Hum Ney Un Ki Yaad Main Ro Ro Kar Matkey Bhar Diye &lt;br /&gt;Wo Bewafa Aye Aur Naha Kar Chal Diye &lt;br /&gt;&lt;br /&gt;73 Neend mujhey raat bhar aati hai kam , &lt;br /&gt;Shayad macharon ko bi mil gaya hai sanam &lt;br /&gt;&lt;br /&gt;74 Tujh bin zindagi ka tasawar hi nehi hai , &lt;br /&gt;Tere sang ho zindagi aisa bi koi scene nehi hai &lt;br /&gt;Iss dunya mein, tum he sab sey haseen ho &lt;br /&gt;mein aur kahon jhot kitna, ke tum ko yaqeen ho &lt;br /&gt;&lt;br /&gt;75 rooz khawab mein nazar aatey ho tum &lt;br /&gt;kio mujhey neend mein bi daratay ho tum &lt;br /&gt;&lt;br /&gt;76 kal raat machar ne kata mere chehre par, &lt;br /&gt;dil mien junoon tha...aankhoon mien khoon tha, &lt;br /&gt;uthaya ussay masal dene k liye par khayal aya, &lt;br /&gt;kambakht mien apna hi khoon thA &lt;br /&gt;&lt;br /&gt;77 hi u all &lt;br /&gt;i hv one puppy 4 u &lt;br /&gt;1puppy 4 ur friend &lt;br /&gt;1 puppy for ur fri ke fri &lt;br /&gt;u know why??? &lt;br /&gt;becuz....... ..... &lt;br /&gt;ajj hi meray dogi nay 10 puppies ko janam dia hai &lt;br /&gt;&lt;br /&gt;78 Civic VTI jisai kehete ho wo gadi tumaree hai &lt;br /&gt;Jisey nokia 6600 kehte ho wo cell tumhara hai &lt;br /&gt;Jinhai tum aamon k baghat kehte ho woh baghain tumharee hain &lt;br /&gt;Kaho ik di kaho ik din &lt;br /&gt;Ager sab kuch ye mera hai to sab kuch dedo ik din &lt;br /&gt;Gari apni mujhe tum dedo cell dedo doosrey din &lt;br /&gt;merey hathon mai kaghzat rakh ker dafa ho ik din &lt;br /&gt;Dafa ho ik din dafa ho ik din... &lt;br /&gt;&lt;br /&gt;79 dabe mein daba dabe mein kharghosh, &lt;br /&gt;uncle nae ankh mari anute behosh......  &lt;br /&gt;&lt;br /&gt;80 teen dost tha phalla patan dosra panjabe or tisra memon.Ramzan ka &lt;br /&gt;maina &lt;br /&gt;tha dostoo na bolaa ka yar zakat dana ha too app log kasa datta ho.too &lt;br /&gt;phala dost patan na bolla ka hum khali maidan ma za kar gol paira &lt;br /&gt;banatha ha or asman ma paisa ushal tha ha zoo paisa paira ka bhair &lt;br /&gt;zata ha &lt;br /&gt;woo zakat kartta ha or zoo andar hotta ha woo humara hotta ha .fer &lt;br /&gt;pajabe na bolla ka hum ak lakir kachtta ha or paisa ushal tha ha zoo &lt;br /&gt;paisa &lt;br /&gt;left hand par zatta ha woo zakat kartta ha or zoo right hand par woo &lt;br /&gt;humara.fer memon dost sa pucha ka woo kasa kartta ha too usna kaha ka &lt;br /&gt;astag feroollha app log assa zakat kartta ho yea lakir fakir keya ha &lt;br /&gt;hum &lt;br /&gt;khali maidan ma zatta ha or asman ma husal tha ha zoo paisa asman ma &lt;br /&gt;gheya woo zakat ka or zoo paisa necha aaya woo humara. &lt;br /&gt;&lt;br /&gt;81 Admi Naai Se Meri TERE NAAM Wali Cutting Kar Do. &lt;br /&gt;Naai Uski Tind Kar Deta Hai &lt;br /&gt;Admi Ghussay Se Ye Kya Kiya Hai ??? &lt;br /&gt;Naai Main Kya Karoon Main Ne Dekhi Hi End Se Hai. &lt;br /&gt;&lt;br /&gt;82 Sardarji is in Delhi. He is walking on a street which has Clock Tower &lt;br /&gt;when someone asks him if he wants to buy the clock on the Tower. &lt;br /&gt;Sardarji says &quot;Yes&quot;. &lt;br /&gt;&quot;Give me a thousand rupees and I&#39;ll go get a ladder.&quot; The man took the &lt;br /&gt;thousand and disappeared. Having waited for several hours the Sardarji &lt;br /&gt;figured he was taken for a ride. On the next day the Sardarji is again &lt;br /&gt;walking along the same street and the same man asks him to buy the &lt;br /&gt;clock. &quot;Give me a thousand rupees and I&#39;ll go get a ladder.&quot; &lt;br /&gt;The Sardarji gives him the thousand and says &quot;I am not a fool.This &lt;br /&gt;time, you wait and I&#39;ll go get a ladder.&quot; &lt;br /&gt;&lt;br /&gt;83 A lawyer is standing in a long line at the box office. Suddenly, he &lt;br /&gt;feels a pair of hands kneading his shoulders, back, and neck. The &lt;br /&gt;lawyer turns around. &lt;br /&gt;&quot;What the hell do you think you&#39;re doing?&quot; &lt;br /&gt;&quot;I&#39;m a chiropractor, and I&#39;m just keeping in practice while I&#39;m &lt;br /&gt;waiting in line.&quot; &lt;br /&gt;&quot;Well, I&#39;m a lawyer, but you don&#39;t see me screwing the guy in front &lt;br /&gt;of me, do you?&quot; &lt;br /&gt;&lt;br /&gt;84 Q: Hear about the terrorist that hijacked a 747 full of lawyers? &lt;br /&gt;A: He threatened to release one every hour if his demands weren&#39;t met. &lt;br /&gt;&lt;br /&gt;85 Safed saari par jab tum laalbindi lagati ho &lt;br /&gt;khuda ki kasam ambulance nazar aati ho &lt;br /&gt;farq sirf itna hai ke wo ghayal ko le jati hai &lt;br /&gt;or tum ghayal kar jati ho &lt;br /&gt;&lt;br /&gt;86 janab patan: eak dookan per jata hai aor kata hai40 wala chawal hai. &lt;br /&gt;dukan daar: je hai &lt;br /&gt;janab patan:eak kulo dado &lt;br /&gt;dukan daar: je janab &lt;br /&gt;janab patan : 40 wala chawal kitna ka diya hai. &lt;br /&gt;&lt;br /&gt;87 Aik haseen-o-jameel adaakara ke ghar aag lag gaee ..aag par qabu panay &lt;br /&gt;main 10 minut lagay.....aor. ......aag bujhany walon per qabu panay &lt;br /&gt;main &lt;br /&gt;40 minut lagay &lt;br /&gt;&lt;br /&gt;88 Aik aadmi apne dost ki qabar par phool daal raha hota he &lt;br /&gt;Aur brabar men bhi aik aadmi apne dost ki qabar par chawal daal raha &lt;br /&gt;hota he. &lt;br /&gt;Pehla Aadmi doosre se kehta he &quot; Ye tumhara dost phool sunghne kab &lt;br /&gt;uthe ga?&quot; &lt;br /&gt;Doosra dost:&quot;Jab tumhara dost chawal khane uthe ga &lt;br /&gt;&lt;br /&gt;89 uncle aik bachay se kehte hain : beta aik acha sa jhoot bolo agar &lt;br /&gt;mujhe &lt;br /&gt;pasand agaya to main tumhien paanch rupay doon ga &lt;br /&gt;bacha masoomiat se : yeh lo ! abhi to das rupay kahay thay .... !!!! &lt;br /&gt;&lt;br /&gt;90 aik dost dosray se : yaar har party mien tum yehi kurta kyun pehantay &lt;br /&gt;ho &lt;br /&gt;dosra dost : kyun ke yeh mera khandani kurta hai mere par dada ne &lt;br /&gt;pehna &lt;br /&gt;phir dada ne pehna phir mere walid ne pehna iss liye main bhi pehanta &lt;br /&gt;hoon &lt;br /&gt;pehla dost : ohh acha .. khier yeh batao k tumhari umar hogai hai &lt;br /&gt;shadi &lt;br /&gt;ki tum kartay kyun nahi ..kya koi larki pasand nahi ati &lt;br /&gt;dosra dost : nahi yaar larkiyaan to bohat pasand ati hain &lt;br /&gt;pehla dost : to phir kyun nahi kartay &lt;br /&gt;dosra dost : yaar mere par dada ne nahi ki dada ne nahi ki mere walid &lt;br /&gt;ne nahi ki to phir main kaise karloon ?? &lt;br /&gt;&lt;br /&gt;91 Banta Singh happened to be in a queue at a railway &lt;br /&gt;station ticket counter with two men ahead of him. &lt;br /&gt;&#39;Ek Punjab Mail dena.&#39; demanded the man in front. &lt;br /&gt;He was given a ticket. &#39;Ek Punjab Mail dena.&#39; &lt;br /&gt;the second man asked &amp; was handed a ticket. &lt;br /&gt;Then came the turn of Banta Singh, &#39;Ek Punjab female dena!&#39; &lt;br /&gt;&#39;What do u mean by Punjab female?&#39; asked the clerk. &lt;br /&gt;&#39;It is for my wife&#39; replied Banta Singh &lt;br /&gt;&lt;br /&gt;92 The Equation: &lt;br /&gt;&lt;br /&gt;7 Glance = 1 Smile &lt;br /&gt;7 Smile = 1 Meeting &lt;br /&gt;7 Meeting = 1 Kiss &lt;br /&gt;7 Kisses = 1 Proposal &lt;br /&gt;7 Proposal = 1 Marriage - &lt;br /&gt;And that 1 Bloody marriage has 777777777777 problems. &lt;br /&gt;So beware of glance! &lt;br /&gt;&lt;br /&gt;93 Plan For Future: &lt;br /&gt;Teacher asks children, what do u wish 2 do in future? &lt;br /&gt;Ram: I want 2 b a pilot. &lt;br /&gt;Vinod: I want 2 b a doctor. &lt;br /&gt;Deepa: I want 2 b a good mother. &lt;br /&gt;Ravi: I want 2 help Deepa. &lt;br /&gt;&lt;br /&gt;94 Exams: &lt;br /&gt;Exams are like GIRL FRIENDS; &lt;br /&gt;1,Too Many Questions. &lt;br /&gt;2,Difficult to Understand. &lt;br /&gt;3,More Explanation is Needed. &lt;br /&gt;4,Result is always FAIL! &lt;br /&gt;&lt;br /&gt;95 A man is dying of Cancer. &lt;br /&gt;His son asked him, &quot;Dad, why do u keep telling people u&#39;re dying of &lt;br /&gt;AIDS?&quot; &lt;br /&gt;Answer: &quot;So when I&#39;m dead no one will dare touch ur mom &lt;br /&gt;&lt;br /&gt;96 Girlfriend : And are you sure you love me and no one else &lt;br /&gt;Boyfriend : Dead Sure! I checked the whole list again yesterday. &lt;br /&gt;&lt;br /&gt;97 Teacher : Which is more important to us, the sun or the moon? &lt;br /&gt;Pupil : The moon. &lt;br /&gt;Teacher : Why? &lt;br /&gt;Pupil : The moon gives us light at night when we need it but the sun gives &lt;br /&gt;us light only in the day time when we dont need it. &lt;br /&gt;&lt;br /&gt;98 Teacher : What do you call a person who keeps on talking when people are no longer interested? &lt;br /&gt;Pupil : A teacher. &lt;br /&gt;&lt;br /&gt;99 Waiter : Would you like your coffee black? &lt;br /&gt;Customer : What other colours do you have? &lt;br /&gt;&lt;br /&gt;100 My father is so old that when he was in school, history was called current affairs. &lt;br /&gt;&lt;br /&gt;101 Teacher : Sam, you talk a lot. &lt;br /&gt;Sam : It&#39;s a family tradition. &lt;br /&gt;Teacher : What do you mean? &lt;br /&gt;Sam : Sir, my grandpa was a street hawker, my father is a teacher. &lt;br /&gt;Teacher : What about your mother? &lt;br /&gt;Sam : She&#39;s a woman. &lt;br /&gt;&lt;br /&gt;102 Tom : How should I convey the news to my father that I&#39;ve failed? &lt;br /&gt;David: You just send a telegram: Result declared, past year&#39;s performance repeated. &lt;br /&gt;&lt;br /&gt;103 Teacher : Now, children, if I saw a man beating a donkey and stopped him, what virtue would I be showing? &lt;br /&gt;Student : Brotherly love. &lt;br /&gt;&lt;br /&gt;104 Teacher : Now, Sam, tell me frankly do you say prayers before eating? &lt;br /&gt;Sam : No sir, I don&#39;t have to, my mom is a good cook. &lt;br /&gt;&lt;br /&gt;105 Patient : What are the chances of my recovering doctor? &lt;br /&gt;Doctor : One hundred percent. Medical records show that nine out of ten people die of the disease you have. &lt;br /&gt;Yours is the tenth case I&#39;ve treated.The others all died. &lt;br /&gt;&lt;br /&gt;106 Teacher : &quot; Hello boys, Remember !!! Nothing is impossible.&quot; &lt;br /&gt;One of the 20 Students: &quot;Ok Sir, You please take out all the toothpaste and put it back into the tube again. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;107 Teacher : &quot; Can anybody give an example of COINCIDENCE ?&quot; &lt;br /&gt;One Student : &quot;Sir, my Mother and Father got married on the sameday, sametime.&quot; &lt;br /&gt;&lt;br /&gt;108 Sardarji opens his lunch box in the middle of the road....why ? &lt;br /&gt;Just to confirm whether he is going to or coming back from the office &lt;br /&gt;&lt;br /&gt;109 A woman had 8 sons all named Kevin. On asking how she managed to call one in &lt;br /&gt;particular &lt;br /&gt;She replied: That&#39;s easy. I call them by their surname ! &lt;br /&gt;&lt;br /&gt;110 koi apni biwi ka antim sanskar karke ghar ja raha tha ki achanak bijli &lt;br /&gt;chamki, badal garje, jor se baarish shuru hui dukhi aadmi bola: &lt;br /&gt;Lagta hai pahunch gai :-) &lt;br /&gt;&lt;br /&gt;111 Sardar enters kitchen and opens the sugarbox. Sees inside and closes it. &lt;br /&gt;Wife observes the whole episode &lt;br /&gt;Again he comes and does the same stuff. Wife askes Why are you doing this? &lt;br /&gt;Sardar replies: Doc told to check sugar level regularly &lt;br /&gt;&lt;br /&gt;112 What is the full form of singh: S-sardar I-insaan N-nahi G-gadha H-hai. &lt;br /&gt;&lt;br /&gt;113 Angry sardar-Oye mein is duniya ko mita dunga - mita dunga- mita dunga. &lt;br /&gt;Another sardar standing besides said mein tujhe rubber nahi dunga. &lt;br /&gt;&lt;br /&gt;114 Santa singh: Can u spell a word that has more than 100 letters in it? &lt;br /&gt;Banta singh: Post office. &lt;br /&gt;&lt;br /&gt;115 Sardar on cycle hit lady accidently, lady says,&quot; break nahi mar sakta tha kya? &lt;br /&gt;Sardar replies &quot;break ka kya hai, poori cycle to mar di.....&quot; &lt;br /&gt;&lt;br /&gt;116 Sardarji zebra crossing ke black &amp; white patte par bar bar idhar-udhar chalte the, woh kya soch rahe honge....think. ......... ... &lt;br /&gt;&quot;SALA YE PIANO BAJTA KYO NAHI&quot; &lt;br /&gt;&lt;br /&gt;117 Sardar:Aap kitna padhe ho? &lt;br /&gt;Friend: B.A. &lt;br /&gt;Sardar: kamal karte ho yaar sirf do word padhe aur woh bhi ulte. &lt;br /&gt;&lt;br /&gt;118 A friend asks sardar how was ur exam? &lt;br /&gt;Sardar: It was ok but i couldnt answer past tense of THINK. I thought, thought &amp; finally i wrote &#39;THUNK&#39;. &lt;br /&gt;&lt;br /&gt;119 Sardar: Doctor help me, mein jab baat karta huun to muje sirf awaaz sunaideti hai, aadmi nahi dikhta. &lt;br /&gt;Dr: Aaisa kab hota hai? &lt;br /&gt;Sardar: Phone karte waqt. &lt;br /&gt;&lt;br /&gt;120 Sardar jhad pe bethkar gaa rahe the, achanak ek sardar jhad se ulta &lt;br /&gt;latak ke gaane laga, dusre ne pucha ki ulta kyon latka he, Sardar bola oye side B gaa raha hun. &lt;br /&gt;&lt;br /&gt;121 Sardarni asks her lover,&quot;Santa dear, if we get engaged, will u give me a ring?&quot; &lt;br /&gt;&quot;Sure&quot; replies santa. &quot;Whats ur phone no?&quot; &lt;br /&gt;&lt;br /&gt;122 Sardarji is not sleeping with his wife! these days &lt;br /&gt;because somebody had told him that it is wrong to sleep with married women. &lt;br /&gt;&lt;br /&gt;123 One day sardarji was sitting in his office on the thirteenth floor of a &lt;br /&gt;building when a man came running in to his office and shouted &quot;Santa singh &lt;br /&gt;your daughter Preeto just died in an accident&quot; ....... since Sardarji was in panic. &lt;br /&gt;Not knowing what to do he jumped from his office window while comming down when he was near the &lt;br /&gt;tenth floor he remembered he didn&#39;t have a daughter named Preeto. &lt;br /&gt;when he was near the fifth floor he remembered he was not married. &lt;br /&gt;&lt;br /&gt;124 *** Banta Singh finished his English exam and came out. &lt;br /&gt;His friends asked him how did he do his exam, for that he replied &quot;Exam was &lt;br /&gt;okay, but for the past tense of THINK, I thought, thought, thought ... and &lt;br /&gt;at last wrote - THUNK !!!&quot; &lt;br /&gt;&lt;br /&gt;125 a sardar was going on the road.Then he sees a man who has met with an &lt;br /&gt;accident.so he picks him up puts him in his car and takes him to the &lt;br /&gt;hospital.Then the sardar realises that the man should have brought by &lt;br /&gt;ambulance.so he takes him back where he picked him &lt;br /&gt;sardar was driving a car. Suddenly one tyre was puncher.he took spear tyre &lt;br /&gt;and changed in the place of punchered tyre. but unfortunately he misplaced &lt;br /&gt;the four screws to fit the tyre on its place . he was so confused ,,now &lt;br /&gt;what to do,, a pagal(mentally retaired) person was watching this incident. &lt;br /&gt;He came near to sardar and said,&quot; do one thing,, take each one screw from &lt;br /&gt;the remaining three tyre and fit it in this new tyre.There after u can go &lt;br /&gt;where ever u want to. Sardar was so happy and said aree yaar Duniya tume &lt;br /&gt;pagal kahate hai lakin i dont think u are a pagal. pagal replied sir,, i m &lt;br /&gt;a pagal but i m not a sardar. &lt;br /&gt;&lt;br /&gt;126 Once a Sardar ji rescued 6 people from a house burning on fire; &lt;br /&gt;But still the Sardar ji was jailed, why? &lt;br /&gt;Because all the rescued persons were fire fighters &lt;br /&gt;&lt;br /&gt;127 TEACHER: Why are you late? &lt;br /&gt;L-JOHNY: Because of the sign. &lt;br /&gt;TEACHER: What sign? &lt;br /&gt;L-JOHNY: The one that says, &quot;School Ahead, Go Slow.&quot; &lt;br /&gt;&lt;br /&gt;128 TEACHER: Johny, why are you doing your maths sums on the floor? &lt;br /&gt;L-JOHNY: You told me to do it without using tables! &lt;br /&gt;&lt;br /&gt;129 TEACHER: Johny, how do you spell &quot;crocodile&quot;? &lt;br /&gt;L-JOHNY: &quot;K-R-O-K-O-D- A-I-L&quot; &lt;br /&gt;TEACHER: No, that&#39;s wrong &lt;br /&gt;L-JOHNY: Maybe it&#39;s wrong, but you ask me how I spell it! &lt;br /&gt;&lt;br /&gt;130 TEACHER: What is the chemical formula for water? &lt;br /&gt;L-JOHNY: &quot;HIJKLMNO&quot;!! &lt;br /&gt;TEACHER: What are you talking about? &lt;br /&gt;L-JOHNY: Yesterday you said it&#39;s H to O! &lt;br /&gt;TEACHER: Johny, why are you doing your maths sums on the floor? &lt;br /&gt;L-JOHNY: You told me to do it without using tables! &lt;br /&gt;&lt;br /&gt;131 TEACHER: George, go to the map and find North America. &lt;br /&gt;GEORGE: Here it is! &lt;br /&gt;TEACHER: Correct. Now, Johny, who discovered America? &lt;br /&gt;JOHNY: George! &lt;br /&gt;&lt;br /&gt;132 TEACHER: Johny, name one important thing we have today that we &lt;br /&gt;didn&#39;t have ten years ago. &lt;br /&gt;L-JOHNY: Me! &lt;br /&gt;&lt;br /&gt;133 TEACHER: Johny, why do you always get so dirty? &lt;br /&gt;L-JOHNY: Well, I&#39;m a lot closer to the ground then you are. &lt;br /&gt;&lt;br /&gt;134 L-JOHNY: Dad, can you write in the dark? &lt;br /&gt;FATHER: I think so. What do you want me To write? &lt;br /&gt;L-JOHNY: Your name on this report card. &lt;br /&gt;&lt;br /&gt;135 TEACHER: How can you prevent diseases caused by biting insects? &lt;br /&gt;L-JOHNY: Don&#39;t bite any. &lt;br /&gt;&lt;br /&gt;136 TEACHER: Johny, give me a sentence starting with &quot;I&quot;. &lt;br /&gt;L-JOHNY: I is... &lt;br /&gt;TEACHER: No, Johny. Always say, &quot;I am.&quot; &lt;br /&gt;L-JOHNY: All right... &quot;I am the ninth letter of the alphabet.&quot; &lt;br /&gt;&lt;br /&gt;137 Teacher: &quot;Can anybody give an example of COINCIDENCE?&quot; &lt;br /&gt;L-Johnny : &quot;Sir, my Mother and Father got married on the sameday &lt;br /&gt;sametime.&quot; &lt;br /&gt;&lt;br /&gt;138 Question: There are 10 elephants swimming in a pond. A boy jumps inside and &lt;br /&gt;swims underneath them and counts the number of legs. &lt;br /&gt;There are only 36 legs.HOW?? &lt;br /&gt;Answer: One elephant was swimming BACKSTROKE!! &lt;br /&gt;&lt;br /&gt;139 L-Johnny : Daddy, have you ever been to Egypt? &lt;br /&gt;Father : No. Why do you ask that? &lt;br /&gt;L-Johnny : Well, where did you get THIS mummy then? &lt;br /&gt;&lt;br /&gt;140 Teacher : What a pair of strange socks you are wearing, one is &lt;br /&gt;green and one is blue with red spots! &lt;br /&gt;L-Johnny: Yes it&#39;s really strange. I&#39;ve got another pair of the same &lt;br /&gt;at home. &lt;br /&gt;&lt;br /&gt;141 Teacher: Now, Johny, tell me frankly do you say prayers before &lt;br /&gt;eating? &lt;br /&gt;L-Johnny : No sir, I don&#39;t have to, my mom is a good cook. &lt;br /&gt;&lt;br /&gt;142 Teacher: Johny, your composition on &quot;My Dog&quot; is exactly the same as &lt;br /&gt;your brother&#39;s. Did u copy his? &lt;br /&gt;L-Johnny: No, teacher, it&#39;s the same dog! &lt;br /&gt;&lt;br /&gt;Hope U all will enjoy this guys!!</content><link rel='replies' type='application/atom+xml' href='http://gudurin.blogspot.com/feeds/4125961783891076792/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1819512445879631740/4125961783891076792' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1819512445879631740/posts/default/4125961783891076792'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1819512445879631740/posts/default/4125961783891076792'/><link rel='alternate' type='text/html' href='http://gudurin.blogspot.com/2009/09/142-jokes-exclusive.html' title='142 jokes exclusive'/><author><name>Naresh Guduri Blog</name><uri>http://www.blogger.com/profile/02461913656830998473</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1819512445879631740.post-5067992961416396051</id><published>2009-08-31T09:30:00.000-07:00</published><updated>2009-08-31T09:32:16.933-07:00</updated><title type='text'>C# events vs. delegates</title><content type='html'>C# events vs. delegates&lt;br /&gt;&lt;br /&gt;We have looked at delegates and their implementation in two previous articles. But if you searched some more information about delegates on the web, you surely noticed they are almost always associated with the &quot;event&quot; construct.&lt;br /&gt;Online event tutorials make it look like events are something pretty different from regular delegates instance, although related. Events are usually explained as if they were a special type or construct. But we will see they really are a modifier on the delegate type, which adds some restrictions that the compiler enforces and also adds two accessors (similar to the get and set for properties).&lt;br /&gt;&lt;br /&gt;A first look at event vs. regular delegate&lt;br /&gt;As I was finishing my previous posts on delegates, another C# construct started baking my noodle: events. Events definitely seem related to delegates, but I couldn&#39;t figure out how they differ.&lt;br /&gt;&lt;br /&gt;From their syntax, events look like a field holding a combination of delegates, which is just what a multicast delegate is. Also they support the same combination operators as delegates (+ and -).&lt;br /&gt;In the following sample program (which has no useful functionality what-so-ever) we see that msgNotifier (with event construct) and msgNotifier2 (plain delegate) appear to behave exactly the same way for all intents and purposes.&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;namespace EventAndDelegate&lt;br /&gt;{&lt;br /&gt;  delegate void MsgHandler(string s);&lt;br /&gt;&lt;br /&gt;  class Class1&lt;br /&gt;  { &lt;br /&gt;    public static event MsgHandler msgNotifier;&lt;br /&gt;    public static MsgHandler msgNotifier2;&lt;br /&gt;    [STAThread]&lt;br /&gt;    static void Main(string[] args)&lt;br /&gt;    {&lt;br /&gt;     Class1.msgNotifier += new MsgHandler(PipeNull);&lt;br /&gt;     Class1.msgNotifier2 += new MsgHandler(PipeNull);&lt;br /&gt;     Class1.msgNotifier(&quot;test&quot;);&lt;br /&gt;     Class1.msgNotifier2(&quot;test2&quot;);&lt;br /&gt;    }&lt;br /&gt; &lt;br /&gt;    static void PipeNull(string s) &lt;br /&gt;    {&lt;br /&gt;     return;&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Looking at the IL code for the Main method in this code, you will notice that both delegates msgNotifier and msgNotifier2 are again used exactly the same way.&lt;br /&gt;.method private hidebysig static void Main(string[] args) cil managed&lt;br /&gt;{&lt;br /&gt;  .entrypoint&lt;br /&gt;  .custom instance void [mscorlib]System.STAThreadAttribute::.ctor() = ( 01 00 00 00 ) &lt;br /&gt;  // Code size 95 (0x5f)&lt;br /&gt;  .maxstack 4&lt;br /&gt;  IL_0000: ldsfld class EventAndDelegate.MsgHandler  EventAndDelegate.Class1::msgNotifier&lt;br /&gt;  IL_0005: ldnull&lt;br /&gt;  IL_0006: ldftn void EventAndDelegate.Class1::PipeNull(string)&lt;br /&gt;  IL_000c: newobj instance void EventAndDelegate.MsgHandler::.ctor(object,&lt;br /&gt;     native int)&lt;br /&gt;  IL_0011: call class [mscorlib]System.Delegate [mscorlib]System.Delegate::Combine(class [mscorlib]System.Delegate,&lt;br /&gt;     class [mscorlib]System.Delegate)&lt;br /&gt;  IL_0016: castclass EventAndDelegate.MsgHandler&lt;br /&gt;  IL_001b: stsfld class EventAndDelegate.MsgHandler EventAndDelegate.Class1::msgNotifier&lt;br /&gt;  IL_0020: ldsfld class EventAndDelegate.MsgHandler EventAndDelegate.Class1::msgNotifier2&lt;br /&gt;  IL_0025: ldnull&lt;br /&gt;  IL_0026: ldftn void EventAndDelegate.Class1::PipeNull(string)&lt;br /&gt;  IL_002c: newobj instance void EventAndDelegate.MsgHandler::.ctor(object,&lt;br /&gt;     native int)&lt;br /&gt;  IL_0031: call class [mscorlib]System.Delegate [mscorlib]System.Delegate::Combine(class [mscorlib]System.Delegate,&lt;br /&gt;     class [mscorlib]System.Delegate)&lt;br /&gt;  IL_0036: castclass EventAndDelegate.MsgHandler&lt;br /&gt;  IL_003b: stsfld class EventAndDelegate.MsgHandler EventAndDelegate.Class1::msgNotifier2&lt;br /&gt;  IL_0040: ldsfld class EventAndDelegate.MsgHandler EventAndDelegate.Class1::msgNotifier&lt;br /&gt;  IL_0045: ldstr &quot;test&quot;&lt;br /&gt;  IL_004a: callvirt instance void EventAndDelegate.MsgHandler::Invoke(string)&lt;br /&gt;  IL_004f: ldsfld class EventAndDelegate.MsgHandler EventAndDelegate.Class1::msgNotifier2&lt;br /&gt;  IL_0054: ldstr &quot;test2&quot;&lt;br /&gt;  IL_0059: callvirt instance void EventAndDelegate.MsgHandler::Invoke(string)&lt;br /&gt;  IL_005e: ret&lt;br /&gt;} // end of method Class1::Main&lt;br /&gt;&lt;br /&gt;Looking at the C# keywords list on MSDN. It turns out that event is only a modifier. The question is what modification does it bring?&lt;br /&gt;&lt;br /&gt;The added value of event&lt;br /&gt;Events and interfaces&lt;br /&gt;First, an event can be included in an interface declaration, whereas a field cannot. This is the most important behavior change introduced by the event modifier. For example:&lt;br /&gt;interface ITest &lt;br /&gt;{&lt;br /&gt;  event MsgHandler msgNotifier; // compiles&lt;br /&gt;  MsgHandler msgNotifier2; // error CS0525: Interfaces cannot contain fields&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;class TestClass : ITest&lt;br /&gt;{&lt;br /&gt;  public event MsgHandler msgNotifier; // When you implement the interface, you need to implement the event too&lt;br /&gt;  static void Main(string[] args) {}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Event invocation&lt;br /&gt;Furthermore, an event can only be invoked from within the class that declared it, whereas a delegate field can be invoked by whoever has access to it. For example:&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;namespace EventAndDelegate&lt;br /&gt;{&lt;br /&gt;  delegate void MsgHandler(string s);&lt;br /&gt;&lt;br /&gt;  class Class1&lt;br /&gt;  { &lt;br /&gt;    public static event MsgHandler msgNotifier;&lt;br /&gt;    public static MsgHandler msgNotifier2;&lt;br /&gt;&lt;br /&gt;    static void Main(string[] args)&lt;br /&gt;    {&lt;br /&gt;     new Class2().test();&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt; &lt;br /&gt;  class Class2 &lt;br /&gt;  {&lt;br /&gt;    public void test() &lt;br /&gt;    {&lt;br /&gt;     Class1.msgNotifier(&quot;test&quot;); // error CS0070: The event &#39;EventAndDelegate.Class1.msgNotifier&#39; can only appear on the left hand side of += or -= (except when used from within the type &#39;EventAndDelegate.Class1&#39;)&lt;br /&gt;     Class1.msgNotifier2(&quot;test2&quot;); // compiles fine&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;This restriction on invocations is quite strong. Even derived classes from the class declaring the event aren&#39;t allowed to fire the event. A way to deal with this is to have a protected virtual method to trigger the event.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Event accessors&lt;br /&gt;Also, events come with a pair of accessor methods. They have an add and remove method. &lt;br /&gt;This is similar to properties, which offer a pair of get and set methods.&lt;br /&gt;&lt;br /&gt;You are allowed to override these accessors, as shown in examples 2 and 3 on this C# event modifier reference on MSDN. Although I don&#39;t see how example 2 is useful, you could imagine that you could have a custom add to send some notification or write a log entry, for example, when a listener is added to your event.&lt;br /&gt;The add and remove accessors need to be customized together, otherwise you get error CS0065 (&#39;Event.TestClass.msgNotifier&#39; : event property must have both add and remove accessors). &lt;br /&gt;Looking at the IL for a previous example, where the event accessors weren&#39;t customized, I noticed compiler generated methods (add_msgNotifier and remove_msgNotifier) for the msgNotifier event. But they weren&#39;t used, and whenever the event was accessed the same IL code was duplicated (inlined).&lt;br /&gt;But when you customize these accessors and look at the IL again, you&#39;ll notice that the generated accessors are now used when you access the event. For example, this code :&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;namespace Event&lt;br /&gt;{&lt;br /&gt;  public delegate void MsgHandler(string msg);&lt;br /&gt;&lt;br /&gt;  interface ITest &lt;br /&gt;  {&lt;br /&gt;   event MsgHandler msgNotifier; // compiles&lt;br /&gt;   MsgHandler msgNotifier2; // error CS0525: Interfaces cannot contain fields&lt;br /&gt;  }&lt;br /&gt; &lt;br /&gt;  class TestClass : ITest&lt;br /&gt;  {&lt;br /&gt;   public event MsgHandler msgNotifier &lt;br /&gt;   {&lt;br /&gt;    add &lt;br /&gt;    { &lt;br /&gt;     Console.WriteLine(&quot;hello&quot;);&lt;br /&gt;     msgNotifier += value; &lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;   }&lt;br /&gt; &lt;br /&gt;   static void Main(string[] args)&lt;br /&gt;   {&lt;br /&gt;     new TestClass().msgNotifier += new MsgHandler(TestDel);&lt;br /&gt;   }&lt;br /&gt;   static void TestDel(string x) &lt;br /&gt;   {&lt;br /&gt;   }&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;brings the following IL for the Main method:&lt;br /&gt;{&lt;br /&gt;  .entrypoint&lt;br /&gt;  // Code size 23 (0x17)&lt;br /&gt;  .maxstack 4&lt;br /&gt;  IL_0000: newobj instance void Event.TestClass::.ctor()&lt;br /&gt;  IL_0005: ldnull&lt;br /&gt;  IL_0006: ldftn void Event.TestClass::TestDel(string)&lt;br /&gt;  IL_000c: newobj instance void Event.MsgHandler::.ctor(object,&lt;br /&gt;     native int)&lt;br /&gt;  IL_0011: call instance void Event.TestClass::add_msgNotifier(class Event.MsgHandler)&lt;br /&gt;  IL_0016: ret&lt;br /&gt;} // end of method TestClass::Main&lt;br /&gt;&lt;br /&gt;Event signature&lt;br /&gt;Finally, even though C# allows it, the .NET framework adds a restriction on the signature of delegates that can be used as events. The signature should be foo(object source, EventArgs e), where source is the object that fired the event and e contains any additional information about the event.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Conclusion&lt;br /&gt;We have seen that the event keyword is a modifier for a delegate declaration that allows it to be included in an interface, constraints it invocation from within the class that declares it, provides it with a pair of customizable accessors (add and remove) and forces the signature of the delegate (when used within the .NET framework).</content><link rel='replies' type='application/atom+xml' href='http://gudurin.blogspot.com/feeds/5067992961416396051/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1819512445879631740/5067992961416396051' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1819512445879631740/posts/default/5067992961416396051'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1819512445879631740/posts/default/5067992961416396051'/><link rel='alternate' type='text/html' href='http://gudurin.blogspot.com/2009/08/c-events-vs-delegates.html' title='C# events vs. delegates'/><author><name>Naresh Guduri Blog</name><uri>http://www.blogger.com/profile/02461913656830998473</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1819512445879631740.post-6042223687097026282</id><published>2009-08-29T23:57:00.000-07:00</published><updated>2009-08-30T00:01:38.690-07:00</updated><title type='text'>9 Important XML Syntax Rules You Must Know</title><content type='html'>&lt;span style=&quot;font-weight:bold;&quot;&gt;&lt;br /&gt;9 Important XML Syntax Rules You Must Know&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;XML became a W3C Recommendation on February 10, 1998. It has been amazing to see how quickly the XML standard has developed, and how quickly a large number of software vendors have adopted the standard. The syntax rules of XML are very simple and logical. The rules are easy to learn, and easy to use.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;1. All XML Elements Must Have a Closing Tag&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In HTML, you will often see elements that don&#39;t have a closing tag:&lt;br /&gt;&lt;br /&gt;&lt;p&gt;This is a paragraph&lt;br /&gt;&lt;p&gt;This is another paragraph&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In XML, it is illegal to omit the closing tag. All elements must have a closing tag:&lt;br /&gt;&lt;br /&gt;&lt;p&gt;This is a paragraph&lt;/p&gt;&lt;br /&gt;&lt;p&gt;This is another paragraph&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Note: You might have noticed from the previous example that the XML declaration did not have a closing tag. This is not an error. The declaration is not a part of the XML document itself, and it has no closing tag.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;&lt;br /&gt;2. XML Tags are Case Sensitive&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;XML elements are defined using XML tags.&lt;br /&gt;&lt;br /&gt;XML tags are case sensitive. With XML, the tag &lt;Letter&gt; is different from the tag &lt;letter&gt;.&lt;br /&gt;&lt;br /&gt;Opening and closing tags must be written with the same case:&lt;br /&gt;&lt;br /&gt;&lt;Message&gt;This is incorrect&lt;/message&gt;&lt;br /&gt;&lt;message&gt;This is correct&lt;/message&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Note: &quot;Opening and closing tags&quot; are often referred to as &quot;Start and end tags&quot;. Use whatever you prefer. It is exactly the same thing.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;&lt;br /&gt;3. XML Elements Must be Properly Nested&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In HTML, you might see improperly nested elements:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;This text is bold and italic&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In XML, all elements must be properly nested within each other:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;This text is bold and italic&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In the example above, &quot;Properly nested&quot; simply means that since the &lt;i&gt; element is opened inside the &lt;b&gt; element, it must be closed inside the &lt;b&gt; element.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;4. XML Documents Must Have a Root Element&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;XML documents must contain one element that is the parent of all other elements. This element is called the root element.&lt;br /&gt;&lt;br /&gt;&lt;root&gt;&lt;br /&gt;&lt;child&gt;&lt;br /&gt;&lt;subchild&gt;.....&lt;/subchild&gt;&lt;br /&gt;&lt;/child&gt;&lt;br /&gt;&lt;/root&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;5. XML Attribute Values Must be Quoted&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;XML elements can have attributes in name/value pairs just like in HTML.&lt;br /&gt;&lt;br /&gt;In XML the attribute value must always be quoted. Study the two XML documents below. The first one is incorrect, the second is correct:&lt;br /&gt;&lt;br /&gt;&lt;note date=12/11/2007&gt;&lt;br /&gt;&lt;to&gt;Tove&lt;/to&gt;&lt;br /&gt;&lt;from&gt;Jani&lt;/from&gt; &lt;br /&gt;&lt;/note&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;note date=&quot;12/11/2007&quot;&gt;&lt;br /&gt;&lt;to&gt;Tove&lt;/to&gt;&lt;br /&gt;&lt;from&gt;Jani&lt;/from&gt;&lt;br /&gt;&lt;/note&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The error in the first document is that the date attribute in the note element is not quoted.&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;&lt;br /&gt;6. Entity References&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Some characters have a special meaning in XML.&lt;br /&gt;&lt;br /&gt;If you place a character like &quot;&lt;&quot; inside an XML element, it will generate an error because the parser interprets it as the start of a new element.&lt;br /&gt;&lt;br /&gt;This will generate an XML error:&lt;br /&gt;&lt;br /&gt;&lt;message&gt;if salary &lt; 1000 then&lt;/message&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To avoid this error, replace the &quot;&lt;&quot; character with an entity reference:&lt;br /&gt;&lt;br /&gt;&lt;message&gt;if salary &amp;lt; 1000 then&lt;/message&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;There are 5 predefined entity references in XML:&lt;br /&gt;&lt;br /&gt;&amp;lt;	&lt;	less than&lt;br /&gt;&amp;gt;	&gt;	greater than&lt;br /&gt;&amp;amp;	&amp;	ampersand &lt;br /&gt;&amp;apos;	&#39;	apostrophe&lt;br /&gt;&amp;quot;	&quot;	quotation mark&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Note: Only the characters &quot;&lt;&quot; and &quot;&amp;&quot; are strictly illegal in XML. The greater than character is legal, but it is a good habit to replace it.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;7. Comments in XML&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The syntax for writing comments in XML is similar to that of HTML.&lt;br /&gt;&lt;br /&gt;&lt;!-- This is a comment --&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;&lt;br /&gt;8. White-space is Preserved in XML&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;HTML truncates multiple white-space characters to one single white-space:&lt;br /&gt;&lt;br /&gt;HTML:	Hello           my name is Tove&lt;br /&gt;Output:	Hello my name is Tove.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;With XML, the white-space in a document is not truncated.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;9. XML Stores New Line as LF&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In Windows applications, a new line is normally stored as a pair of characters: carriage return (CR) and line feed (LF). The character pair bears some resemblance to the typewriter actions of setting a new line. In Unix applications, a new line is normally stored as a LF character. Macintosh applications use only a CR character to store a new line.&lt;br /&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://gudurin.blogspot.com/feeds/6042223687097026282/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1819512445879631740/6042223687097026282' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1819512445879631740/posts/default/6042223687097026282'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1819512445879631740/posts/default/6042223687097026282'/><link rel='alternate' type='text/html' href='http://gudurin.blogspot.com/2009/08/9-important-xml-syntax-rules-you-must.html' title='9 Important XML Syntax Rules You Must Know'/><author><name>Naresh Guduri Blog</name><uri>http://www.blogger.com/profile/02461913656830998473</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1819512445879631740.post-6303502951134530430</id><published>2009-08-23T17:10:00.001-07:00</published><updated>2009-08-23T17:10:25.343-07:00</updated><title type='text'>ఇచ్చట పెళ్ళికొడుకులు అమ్మబడును</title><content type='html'>హైదరాబాదులొ ఈ మధ్య ఒక కొత్త mall తెరిచారు. ఇచ్చట పెళ్ళి కొడుకులు కూడా అమ్మబడును అని ప్రకటనలు ఇచ్చారు (అవును సరిగ్గా పెళ్ళైన కొత్తలో సినిమాలో లాగానే). కాకపోతే కొన్ని షరతులు పెట్టారు, అవి ఏమిటంటే:&lt;br /&gt;&lt;br /&gt;* అమ్మాయిలు మా mallకి ఒక్కసారి మాత్రమే అనుమతింప బడుతారు&lt;br /&gt;* పెళ్ళి కొడుకులని వారి వారి హోదా, రుచులు, అభిరుచులకు తగ్గట్లు వివిధ అంతస్థులలో వర్గీకరించబడ్డారు. ఏ అంతస్థులో పెళ్ళి కొడుకునైనా మీరు ఎన్నుకోవచ్చును. ఆ అంతస్థులో నచ్చకపోతే మీరు మరో అంతస్థుకి వెళ్ళవచ్చు. కాకపోతే మీరు వెనక్కి తిరిగి రావటానికి అస్కారము లేదు, చివరి అంతస్థు నుంచి బయటకు పోవడం తప్ప.&lt;br /&gt;&lt;br /&gt;ఇదేదో బావుందే చూద్దామని ఒక అమ్మాయి mallకి వస్తుంది. అంతస్థులవారీగా ఈ విధంగా సూచనలు ఉన్నాయి.&lt;br /&gt;&lt;br /&gt;మెదటి అంతస్థు: ఈ పెళ్ళి కొడుకులకు ఉద్యోగాలు ఉన్నాయి. భార్యను బాగా చూసుకుంటారు.&lt;br /&gt;&lt;br /&gt;రెండవ అంతస్థు: ఈ పెళ్ళి కొడుకులకు ఉద్యోగాలు ఉన్నాయి. భార్యను బాగా చూసుకుంటారు , పిల్లలను ప్రేమిస్తారు.&lt;br /&gt;&lt;br /&gt;మూడవ అంతస్థు: ఈ పెళ్ళి కొడుకులకు ఉద్యోగాలు ఉన్నాయి. భార్యను బాగా చూసుకుంటారు , పిల్లలను ప్రేమిస్తారు. మరియు వీళ్ళు చాలా అందగాళ్ళు.&lt;br /&gt;&lt;br /&gt;అద్భుతం!! అని అనుకుంటూ ఇంకా పైకి వెళ్తే ఎలా ఉంటుందో అనుకుంటూ వెళ్ళింది ఆ అమ్మాయి.&lt;br /&gt;&lt;br /&gt;నాలుగవ అంతస్థు: ఈ పెళ్ళి కొడుకులకు ఉద్యోగాలు ఉన్నాయి. భార్యను బాగా చూసుకుంటారు , పిల్లలను ప్రేమిస్తారు. మరియు వీళ్ళు చాలా అందగాళ్ళు. ఇంటి పని, వంట పనిలో కూడా సహాయ పడతారు.&lt;br /&gt;&lt;br /&gt;&quot;ఆహా !! ఈ mall చాలా బావుందే. ఈ అంతస్థులో నాకు కావలసిన వరుడు దొరుకుతాడు అని అనుకున్నది. అలా అనుకున్న మరు క్షణమే ఇంకా పైకి వెళ్తే ఎలాంటి వాళ్ళు ఉంటారబ్బా!! అని అనుకొని తరువాతి అంతస్థుకి వెళ్తుంది&quot;.&lt;br /&gt;&lt;br /&gt;అక్కడి సూచన ఇది:&lt;br /&gt;&lt;br /&gt;&quot;మీతో కలిపి ఈ అంతస్థుకి చేరుకున్నవారి సంఖ్య : 61,397. ఈ అంతస్థులో పెళ్ళికొడుకులు లేరు. ఆడవాళ్ళని మెప్పించడం అసాధ్యం.&quot;</content><link rel='replies' type='application/atom+xml' href='http://gudurin.blogspot.com/feeds/6303502951134530430/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1819512445879631740/6303502951134530430' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1819512445879631740/posts/default/6303502951134530430'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1819512445879631740/posts/default/6303502951134530430'/><link rel='alternate' type='text/html' href='http://gudurin.blogspot.com/2009/08/blog-post_23.html' title='ఇచ్చట పెళ్ళికొడుకులు అమ్మబడును'/><author><name>Naresh Guduri Blog</name><uri>http://www.blogger.com/profile/02461913656830998473</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1819512445879631740.post-7730943862230739319</id><published>2009-08-23T17:06:00.001-07:00</published><updated>2009-08-23T17:07:32.016-07:00</updated><title type='text'>most annoying web page on internet</title><content type='html'>guys pls paste this link on your address bar and see what happen.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Code:&lt;br /&gt;&lt;a href=&quot;http://home.comcast.net/~wolfand/&quot;&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;http://home.comcast.net/~wolfand/&lt;br /&gt;dont panic it is not a virus or anything &lt;br /&gt;&lt;br /&gt;just enjoy:ty ping:</content><link rel='replies' type='application/atom+xml' href='http://gudurin.blogspot.com/feeds/7730943862230739319/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1819512445879631740/7730943862230739319' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1819512445879631740/posts/default/7730943862230739319'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1819512445879631740/posts/default/7730943862230739319'/><link rel='alternate' type='text/html' href='http://gudurin.blogspot.com/2009/08/most-annoying-web-page-on-internet.html' title='most annoying web page on internet'/><author><name>Naresh Guduri Blog</name><uri>http://www.blogger.com/profile/02461913656830998473</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1819512445879631740.post-5109836817621249445</id><published>2009-08-20T17:22:00.000-07:00</published><updated>2009-08-20T17:23:01.963-07:00</updated><title type='text'>MagaDheera Remake</title><content type='html'>&lt;object width=&quot;425&quot; height=&quot;344&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/tfhc5RgeaYM&amp;rel=0&amp;color1=0xb1b1b1&amp;color2=0xcfcfcf&amp;hl=en&amp;feature=player_embedded&amp;fs=1&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowScriptAccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;http://www.youtube.com/v/tfhc5RgeaYM&amp;rel=0&amp;color1=0xb1b1b1&amp;color2=0xcfcfcf&amp;hl=en&amp;feature=player_embedded&amp;fs=1&quot; type=&quot;application/x-shockwave-flash&quot; allowfullscreen=&quot;true&quot; allowScriptAccess=&quot;always&quot; width=&quot;425&quot; height=&quot;344&quot;&gt;&lt;/embed&gt;&lt;/object&gt;</content><link rel='replies' type='application/atom+xml' href='http://gudurin.blogspot.com/feeds/5109836817621249445/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1819512445879631740/5109836817621249445' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1819512445879631740/posts/default/5109836817621249445'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1819512445879631740/posts/default/5109836817621249445'/><link rel='alternate' type='text/html' href='http://gudurin.blogspot.com/2009/08/magadheera-remake.html' title='MagaDheera Remake'/><author><name>Naresh Guduri Blog</name><uri>http://www.blogger.com/profile/02461913656830998473</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1819512445879631740.post-4012302555648737269</id><published>2009-08-07T19:21:00.000-07:00</published><updated>2009-08-07T19:41:04.345-07:00</updated><title type='text'>Jokes</title><content type='html'>Hahaha Good one&lt;br /&gt;&lt;br /&gt;An Arab was admitted in the Lilavati Hospital at Mumbai for a heart transplant, but prior to the surgery the doctors needed to store his blood in case need arises. As the gentleman had a rare type of blood, it couldn&#39;t be found locally. So the call went out to the neighboring states.&lt;br /&gt;&lt;br /&gt;Finally a Gujarati was located who had a similar type of blood. The Gujarati willingly donated his blood for the Arab.&lt;br /&gt;&lt;br /&gt;After the surgery, the Arab sent the Gujarati as appreciation for giving his blood, a new BMW 540iL, diamonds, lapis lazuli jewelry, and half a million US dollars.&lt;br /&gt;&lt;br /&gt;Once again the Arab had to go through a corrective surgery. His doctor telephoned the Gujarati who was more than happy to donate his blood again.&lt;br /&gt;&lt;br /&gt;After the second surgery, the Arab sent the Gujarati a thank you card and a box of almond halwa sweets.&lt;br /&gt;&lt;br /&gt;The Gujarati was shocked to see that the Arab this time did not reciprocate the Gujarati&#39;s kind gesture as he had anticipated.&lt;br /&gt;&lt;br /&gt;He phoned the Arab and asked him &quot;This time also I thought that u would give me a new car, Diamonds and Jewelry. But u gave only a card and a box of almond sweets.&lt;br /&gt;&lt;br /&gt;To this the Arab replied &quot;Can&#39;t help it, Bapu..... Now I have Gujju blood in my veins!!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;*************************************************************************************&lt;br /&gt;An American, Japanese, and a Sardar were sitting in the sauna. Suddenly there was&lt;br /&gt;a beeping sound.The American pressed his forearm and the beeping stopped.&lt;br /&gt;The others looked at him questioningly.&quot; That&#39;s my pager,&quot; he&lt;br /&gt;said, &quot;I have a microchip under the skin of my arm. &lt;br /&gt;&lt;br /&gt;A few minutes later phone rang. The Japanese lifted his palm to his ear. When he finished he explained, &quot;That&#39;s my mobile phone. I have a microchip in my hand. &lt;br /&gt;&lt;br /&gt;The Sardar felt low-tech and inferior. He didn&#39;t know what to do&lt;br /&gt;to be as impressive as the American &amp; the Japanese. He decided to take a&lt;br /&gt;break in the toilet. When he returned, he didn&#39;t realize that there was a&lt;br /&gt;piece of toilet paper got stuck and hanging from his backside. The others raised&lt;br /&gt;their eyebrows and said, &quot;Wow! What&#39;s that?&quot; Instead of&lt;br /&gt;being embarrassed, inspiration struck his mind. The Sardar explained, &quot;I&#39;m&lt;br /&gt;getting a FAX. The other two fainted. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;**************************************************************************&lt;br /&gt;&lt;br /&gt;Fed up with people making fun of him, Santa Singh decided to change his religion. He joined a priest in a church as is assistant. One day the priest was called away for an emergency. Not wanting to leave the confessional unattended, he called Santa D&#39;costa (his new assistant) and asked him to cover for him.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Santa told him he wouldn&#39;t know what to say, but the priest told him to stay with him for a little while and learn what to do. Santa joined the priest and then followed him into the confessional.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A few minutes later a woman came in and said &quot;Father, forgive me for I have sinned&quot;&lt;br /&gt;&lt;br /&gt;Priest: &quot;What did you do?&quot; Woman: &quot; I committed adultery&quot;&lt;br /&gt;Priest: &quot;How many times?&quot; Woman: &quot;Three times&quot;&lt;br /&gt;Priest: &quot;Say Two Hail Marys, put $ 5.00 in the charity box, and sin no more.&quot;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A few minutes later a man entered the confessional. He said &quot;Father, forgive me for I have sinned&quot;&lt;br /&gt;Priest: &quot;What did you do?&quot; Man: &quot;I committed adultery&quot;&lt;br /&gt;Priest: &quot;How many times?&quot; Man: &quot;Three times&quot;&lt;br /&gt;Priest: &quot;Say two Hail Marys, put $ 5.00 in the charity box, and sin no more.&quot;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Santa, a quick learner, told the priest that he understood the job and the priest could leave. Santa D&#39;costa was now alone. A few minutes later another woman entered and said &quot;Father, forgive me for I have sinned&quot;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Santa: &quot;What did you do?&quot; Woman: &quot;I committed adultery&quot;&lt;br /&gt;&lt;br /&gt;Santa: &quot;How many times?&quot; Woman: &quot;Once&quot;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Santa: &quot;Go do it two more times, we have a special offer this week, three times for $ 5.00......&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;******************************************************************************&lt;br /&gt;Sardar [fun] detective&lt;br /&gt;A policeman was testing 3 Singh brothers who were training to become detectives.&lt;br /&gt;&lt;br /&gt;To test their skills in recognizing a suspect, he shows thefirst Singh a picture for 5 seconds and then hides it. ‘This is your suspect, how would you recognize him?’&lt;br /&gt;&lt;br /&gt;The first Singh answers, ‘That’seasy, we’ll catch him fast because he only has one eye!’ The policeman&lt;br /&gt;&lt;br /&gt;says, ‘Well…uh.. .that’s because the picture I showed is his side profile.’&lt;br /&gt;&lt;br /&gt;Slightly flustered by this ridiculous response, he flashes the picture for 5 seconds at the second Singh and asks him, ‘This is your suspect, how would you recognize him?’&lt;br /&gt;&lt;br /&gt;The second Singh smiles and says, ‘Ha! He’d be too easy to catch because he only has one ear!’ &lt;br /&gt;&lt;br /&gt;The policeman angrily responds,&lt;br /&gt;&lt;br /&gt;‘What’s the matter with you two? Of course only one eye and one ear are showing because it’s a picture of his side profile! Is that the best answer&lt;br /&gt;&lt;br /&gt;you can come up with?’&lt;br /&gt;&lt;br /&gt;Extremely frustrated at this point, he shows the picture to the third Singh&lt;br /&gt;&lt;br /&gt;and in a very testy voice asks, ‘This is your suspect, how would you recognize him?&lt;br /&gt;&lt;br /&gt;He quickly adds, ‘Think hard before giving me a stupid answer.’ The Singh&lt;br /&gt;&lt;br /&gt;looks at the picture intently for a moment and says, ‘The suspect wears&lt;br /&gt;&lt;br /&gt;contact lenses.’ The policeman is surprised and speechless because he really&lt;br /&gt;&lt;br /&gt;doesn’t know himself if the suspect wears contacts or not. ‘Well, that’s an&lt;br /&gt;&lt;br /&gt;interesting answer. Wait here for a few minutes while I check his file and&lt;br /&gt;&lt;br /&gt;I’ll get back to you on that.’ He leaves the room and goes to his office,&lt;br /&gt;&lt;br /&gt;checks the suspect’s file in his computer, and comes back with a beaming&lt;br /&gt;&lt;br /&gt;smile on his face.&lt;br /&gt;&lt;br /&gt;‘Wow! I can’t believe it. It’s TRUE! The suspect does in fact wear contact&lt;br /&gt;&lt;br /&gt;lenses. Good work! How were you able to make such an astute observation? ‘&lt;br /&gt;&lt;br /&gt;‘That’s easy,’ the Singh replied. ‘He can’t wear regular glasses because he&lt;br /&gt;&lt;br /&gt;only has one eye and one ear.’&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;*******************************************************************&lt;br /&gt;3 sardars are going on a motor cycle.&lt;br /&gt;&lt;br /&gt;A police man shows his hand to stop .&lt;br /&gt;&lt;br /&gt;then sardar shouted ::::--&quot;&quot; OYE IDIOT already 3 are sitting ......where will u sit ??????&quot;&quot;&lt;br /&gt;*********************&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Banta and Kidnap&lt;br /&gt;Banta spending his life in real poverty decides to earn some quick bucks through an illegal way.&lt;br /&gt;He thinks of kidnaping someone and demanding ransom from the parents of that child.&lt;br /&gt;In order to execute his plan, he goes to a nearby park and finds a little girl playing there. He writes a note &quot;I have kidnapped your daughter. Drop by Rs.2,00,000 in the park by 12:00pm tomorrow else your daughter will be killed&quot;.&lt;br /&gt;He pins the note on the girl&#39;s shirts and drops her at her home.&lt;br /&gt;Next day.. &lt;br /&gt;Banta desperately waiting at the park for the money.&lt;br /&gt;That little girl comes with a bag and hands over the bag to Banta with a note. &lt;br /&gt;Banta checks the bag and finds Rs.2,00,000 in the bag. He desparately check the note which happens to be from Santa. It reads....&lt;br /&gt;&quot;Please don&#39;t kill my daughter. I&#39;m sending Rs.2,00,000 with my daughter. Keep it and release my daughter&quot;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;******************************************************&lt;br /&gt;&lt;br /&gt;Doctor aur Santa (Patient) [Hilarious Joke]&lt;br /&gt;Doctor to Santa (Patient): Ab aapki tabiyat kaisi hai?&lt;br /&gt;Santa: Doctor saheb Pehle se jyada kharab ho gayi hai.&lt;br /&gt;Doctor: dawai khali thi kya?&lt;br /&gt;Santa : Nai doctor saheb. Dawai ki shishi to bhari hui thi.&lt;br /&gt;Doctor: Are Santa ji mere kehne ka matlab hai ki, dawai le li thi kya.&lt;br /&gt;Santa: Ji, aapne dawai de di thi aur maine le li thi.&lt;br /&gt;Doctor: Abe, dawai pili thi kya?&lt;br /&gt;Santa: Oho, nahi doctor saheb dawai to lal thi.&lt;br /&gt;Doctor: Abe GADHE, Dawai KO piliya tha kya?&lt;br /&gt;Santa : Nahi. Doctor, Piliya to mujhe tha.&lt;br /&gt;Doctor (in frustration) : Abe Teri to, Dawai ko muh lagakar Pet me dala tha ki nahi?&lt;br /&gt;Santa: Nahi doctor saheb.&lt;br /&gt;Doctor: Kyon?&lt;br /&gt;Santa: Kyonki dhakkan band tha.&lt;br /&gt;Doctor: Teri sale, to khola kyon nai.&lt;br /&gt;Santa: Saheb, aapne hi to kaha tha ki, shishi ka dhakkan band rakhna.&lt;br /&gt;Doctor: Tera ilaj main nahi kar sakta!&lt;br /&gt;Santa: Accha Doctor saheb ye to bata do ki main thik kaise hounga? &lt;br /&gt;Doctor : Abe teri Ã¢â‚¬Â¦@#$!^&amp;*!!!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Intelligent Sardarji &lt;br /&gt;PLEASE READ: As you all know, Sardarji jokes are very famous in India. But we understand that these kind of jokes are targeted toward a particular community and is more a humiliation of them. WE LOVE AND RESPECT OUR SIKH FRIENDS AND DON’T PROMOTE ANYTHING THAT HUMILIATES THEM OR MAKE FUN OF THEIR COMMUNITY. This mail is posted on the website since we found this to be appraising and not humiliating.&lt;br /&gt;A Sardarji and an American are seated next to each other on a flight from Los Angeles to New York. The American asks if he would like to play a fun game.&lt;br /&gt;The Sardarji, tired, just wants to take a nap, so he politely declines and rolls over to the window to catch a few winks.&lt;br /&gt;The American persists and explains that the game is easy and a lot of fun. He says, “I ask you a question, and if you don&#39;t know the answer, you pay me five dollars, and vice versa.”&lt;br /&gt;Again, he declines and tries to get some sleep.&lt;br /&gt;The American, now agitated, says, “Okay, if you don&#39;t know the answer, you pay me $5,and if I don’t know the answer, I will pay you $500.”&lt;br /&gt;This catches the Sardarji&#39;s attention and, figuring there will be no end to this torment, agrees to the game.&lt;br /&gt;The American asks the first question: “What’s the distance from the earth to the moon?”&lt;br /&gt;The Sardarji doesn&#39;t say a word, reaches into his wallet,pulls out a $5.00 bill, and hands it to the American.&lt;br /&gt;“Okay,” says the American, “your turn”.&lt;br /&gt;He asks, “What goes up a hill with three legs and comes down with four legs?” &lt;br /&gt;The American, puzzled, takes out his laptop computer &amp; searches all his preferences........no answer. He taps into the air phone with his modem and searches the Internet and the Library of Congress... no answer.&lt;br /&gt;Frustrated, he sends e-mails to all his friends and coworkers but to no avail.&lt;br /&gt;After an hour, he wakes the Sardarji and hands him $500.&lt;br /&gt;The Sardarji thanks him and turns back to get some more sleep.&lt;br /&gt;The American, who is more than a little miffed, stirs the Sardarji and asks, “Well, what’s the answer?”&lt;br /&gt;Without a word, the Sardarji reaches into his purse, hands the american $5, and goes back to sleep.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Banta’s Letter To Bill Gates&lt;br /&gt;Subject: Problems with my new computer&lt;br /&gt;Dear Mr. Bill Gates,&lt;br /&gt;We have bought a computer for our home and we have found some problems, which I want to bring to your notice.&lt;br /&gt;1. There is a button ‘Start’ but there is no &#39;stop&#39; button. We request you to check this.&lt;br /&gt;2. We find there is ‘Run’ in the menu. One of my friends clicked ‘Run’ he ran up to Amritsar! So, we request you to change that to ‘Sit’, so that we can click that by sitting.&lt;br /&gt;3. One doubt is whether any ‘Re-Scooter’ is available in system? I find only ‘Recycle’, but I own a scooter at my home.&lt;br /&gt;4. There is ‘Find’ button but it is not working properly. My wife lost the door key and we tried a lot trace the key with this ‘Find’ button, but was unable to trace. Please rectify this problem.&lt;br /&gt;5. My child learnt ‘Microsoft Word’ now he wants to learn ‘Microsoft Sentence’, so when you will provide that?&lt;br /&gt;6. I bought computer, CPU, mouse and keyboard, but there is only one icon which shows ‘My Computer’: when you will provide the remaining items?&lt;br /&gt;7. It is surprising that windows says ‘My Pictures’ but there is not even a single photo of mine. So when will you keep my photo in that.&lt;br /&gt;8. There is ‘Microsoft Office’ what about ‘Microsoft Home’ since I use the PC at home only.&lt;br /&gt;9. You provided ‘My Recent Documents’. When you will provide ‘My Past Documents’?&lt;br /&gt;10. You provide ’My Network Places‘. For God sake please do not provide ’My Secret Places‘. I do not want to let my wife know where I go after my office hours.&lt;br /&gt;One personal questions.. How is it that your name is Gates but u are selling WINDOWS?&lt;br /&gt;Regards,&lt;br /&gt;Banta&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Santa’s Interview&lt;br /&gt;Interviewer: Tell me the opposite of good.&lt;br /&gt;Santa: Bad. &lt;br /&gt;Interviewer: Come.&lt;br /&gt;Santa: Go. &lt;br /&gt;Interviewer: Ugly.&lt;br /&gt;Santa: Pichlli. &lt;br /&gt;Interviewer: U G L Y?&lt;br /&gt;Santa: PICHLLY !!!!!!! &lt;br /&gt;Interviewer: Shut Up.&lt;br /&gt;Santa: Keep Talking. &lt;br /&gt;Interviewer: Get Out.&lt;br /&gt;Santa: Come In. &lt;br /&gt;Interviewer: Oh my God.&lt;br /&gt;Santa: Oh your Devil. &lt;br /&gt;Interviewer: You are Rejected.&lt;br /&gt;Santa: I am Selected. &lt;br /&gt;~~~ BALLE BALLLE ~~~ &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;University were to be interviewed for a prestigious job. One common&lt;br /&gt;question was asked to all 4 of them.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;INTERVIEWER: WHICH IS THE FASTEST THING IN THE WORLD?&lt;br /&gt;&lt;br /&gt;YALE guy: Its light, Nothing can travel faster than light&lt;br /&gt;&lt;br /&gt;HARVARD Guy: It&#39;s the Thought; because thought is so fast it comes instantly in&lt;br /&gt;your mind.&lt;br /&gt;&lt;br /&gt;MIT guy: Its Blink, you can blink and its hard to realize you blinked&lt;br /&gt;&lt;br /&gt;SANTA SINGH: Its Loose motion&lt;br /&gt;&lt;br /&gt;INTERVIEWER: (Shocked to hear Santa&#39;s reply, asked) &quot;WHY&quot;?&lt;br /&gt;&lt;br /&gt;SANTA SINGH: Last night after dinner, I was lying in my bed and I got the&lt;br /&gt;worst stomach cramps, and before I could THINK, BLINK, or TURN ON&lt;br /&gt;THE LIGHTS, it was over!!!!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Santa: I have swallowed a key.&lt;br /&gt;Doctor: When?&lt;br /&gt;Santa: 3 months back!&lt;br /&gt;Doctor: What were you doing till now?&lt;br /&gt;Santa: I was using duplicate key, now I have lost it too.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A lady calls Santa for repairing door bell. Banta doesn’t turns up for 4 days.&lt;br /&gt;Lady calls again, Banta replies: I’m coming daily since 4 days, I press the bell but no one comes out. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Lady to inspector Santa: My husband went to buy potatoes 5 days ago, he hasn’t come back yet!&lt;br /&gt;Santa: Why don’t you cook something else?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Banta’s wife dies. He is calm, but his wife’s lover is crying furiously...&lt;br /&gt;Finally, Banta consoles him saying “Don’t worry buddy, I will marry again”.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Santa keeps the door open while bathing.&lt;br /&gt;Banta asking him why is he doing that?&lt;br /&gt;Santa says “I’m afraid that someone might watch me from the key hole”. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Banta apni pregnant wife ko pizza hut le jaa raha tha.&lt;br /&gt;Santa: Oye, apni pregnant wife ko itne dard mein hospital ki jagah pizza hut kyun leja raha hai?&lt;br /&gt;Banta: Kyun key pizza hut mein “Delivery Free” hai.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Banta enters shop shouts, “Where is my free gift with this oil?”&lt;br /&gt;Shopkeeper: Iske saath koi gift nahin hai bhai saab?&lt;br /&gt;Banta: Oye ispe likha to hai “CHOLESTROL FREE”.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;One tourist from U.S.A. asks Santa: Any great man born in this village?&lt;br /&gt;Santa: No sir, only small Babies!!!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Teacher: A for? &lt;br /&gt;Banta: Apple&lt;br /&gt;Teacher: Jor se bolo?&lt;br /&gt;Banta: Jay mata di.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;American says: “US mein shaadi e-mail se hoti hai..”&lt;br /&gt;Santa says: “India me to.. shaadi sirf fe-mail (female) se hoti hai...!!!”&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Banta orders pizza.&lt;br /&gt;Waiter: Sir should I cut it into 4 pieces or into 8 pieces? &lt;br /&gt;Banta: 4 hi kar dena, 8 khaye nahi jayenge.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Santa dials a number. A girl receives the call.&lt;br /&gt;Santa: Who are you?&lt;br /&gt;Girl: Seeta here. &lt;br /&gt;Santa: Maine to Chandigarh phone kiya tha, yeh to Ayodhya chala gaya.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Banta: Truck dekhkar tum kaampte kyon ho?&lt;br /&gt;Santa: Ek truck driver meri biwi lekar bhaag gaya tha, har baar lagta hai&lt;br /&gt;jaise usko vapas karne aya hai.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Pathan sitting on the top of the mountain and studying.&lt;br /&gt;When a person asked what he was doing? &lt;br /&gt;He replied, Oye! Higher studies yaar.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2 pathans were fighting after exam.&lt;br /&gt;Sir: Why are you fighting?&lt;br /&gt;1st pathan: This fool left the answer sheet blank.&lt;br /&gt;Sir: So what?&lt;br /&gt;2nd pathan: Even i did the same thing, now teacher will think that we both copied.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Santa: I’m very kanjoos, I went 2 honeymoon alone saved 1/2 money. &lt;br /&gt;Banta: You are nothing I saved all my money.&lt;br /&gt;Santa: How?&lt;br /&gt;Banta: My friend was going and I sent my wife with him.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Santa goes to Kaun Banega Karodpati show. Amitabh Bachchan asks him, “Santaji aap kiske saath yahan aaye hai?”&lt;br /&gt;Santa: Pitaaji ke saath.&lt;br /&gt;Amitabh: Aap ke pitaaji ka shubhnaam?&lt;br /&gt;Santa: Hmmmm.... yes.&lt;br /&gt;Amitabh: Ammmm.... kya naam hai aapke pitaji ka?&lt;br /&gt;Santa: Hmmmm... OK.&lt;br /&gt;Amitabh: Are Santaji, main aapse aapke pitaji ka naam poochh raha hoon.&lt;br /&gt;Santa: Pehle mujhe 4 options to do!!!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Banta: All of the thrill is gone from my marriage.&lt;br /&gt;Santa: Why not add some intrigue to your life and have an affair?&lt;br /&gt;Banta: But what if my wife finds out?&lt;br /&gt;Santa: Heck, this is a new age we live in. Go ahead and just tell her about it.&lt;br /&gt;Banta goes home to his wife and says, “Preeto, I think an affair will help bring us closer together”.&lt;br /&gt;Preeto, “Forget it, I’ve already tried that. It didn’t work.”&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The headmaster of a school reprimanded Banta. ‘It has been reported that you called your history teacher gadhaa (Ass). You are fined Rs.50.’ &lt;br /&gt;‘Sir, would I be fined if I called a gadhaa my guruji?’ asks Banta.&lt;br /&gt;‘Surely not’, replied the headmaster.&lt;br /&gt;Banta: ‘That’s fine, Guruji!’. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A Manager of the branch bank found he had no space left to store old records.&lt;br /&gt;He wrote to his regional manager Banta to for permission to destroy old records. &lt;br /&gt;Banta Singh replied back: “I do not mind your destroying old records but please make sure you keep photo-copies of all the destroyed papers”. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Santa and Banta decide to go on picnic one day. When they get there, they realize they’ve forgotten the whisky.&lt;br /&gt;Banta says he’ll get it if Santa promises not to eat the chicken till he returns.&lt;br /&gt;Now, Santa waits and waits till a whole day goes by, when Santa says to himself: Come on, I’m hungry. He is not going to come back so let me eat the chicken anyway.&lt;br /&gt;Suddenly Banta pops up from behind a tree and says: If you do that, I won’t go!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Banta showed his palm to a palmist. He examined the lines on Banta’s hand &amp; said, A beautiful girl will come into your life, but be very careful. &lt;br /&gt;Why should I have to be careful? asked Banta. She should be careful of her life. I drive a Blueline bus!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Walking up to a department store’s fabric counter, a pretty girl asked, “I want to buy this material for a new dress. How much does it cost?”&lt;br /&gt;“Only one kiss per meter madam,” replied Banta (clerk).&lt;br /&gt;“That’s fine,” replied the girl. “I’ll take five meters.”&lt;br /&gt;“Five meters only?”, asked Banta “Hmmmmm..”, girl thinks for a moment and said, “OK, give me ten meters”.&lt;br /&gt;With expectation and anticipation written all over his face, Banta hurriedly measured out and wrapped the cloth, then held it out teasingly.&lt;br /&gt;The girl snapped up the package and pointed to a little old man standing beside her and said “Grandpa will pay the bill”.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Santa bought a new mobile.&lt;br /&gt;He called everyone from his Phone Book &amp; said &quot;My Mobile No. has changed.&lt;br /&gt;Earlier it was Nokia 3310 Now it is 6610.&quot; &lt;br /&gt;Santa : I am a Proud Santa, My son is in Medical College.&lt;br /&gt;Banta : Really, what is he studying?&lt;br /&gt;Santa : No he is not studying, they are Studying him. &lt;br /&gt;Santa: What is Common between Krishna, Ram, Gandhiji &amp; Jesus?&lt;br /&gt;Banta: All are Born on Government Holidays. &lt;br /&gt;Pappu, while filling up a form: Dad, what should I write for mother tongue?&lt;br /&gt;Banta: Very long! &lt;br /&gt;Frog: Tumhare paas dimaag nahin hai.&lt;br /&gt;Santa: Hai.&lt;br /&gt;Frog: Nahin hai.&lt;br /&gt;Santa: Hai. Frog: Nahin hai &amp; jumps into the well.&lt;br /&gt;Santa: Isme suicide karne waali kya baat thi? &lt;br /&gt;Banta was caught for speeding and went before the judge.&lt;br /&gt;The judge: What will you take 30 days or Rs.3000?&lt;br /&gt;Banta: I think I&#39;ll take the money. &lt;br /&gt;Santa: My dad was an extremely brave man. He once entered a lion&#39;s cage.&lt;br /&gt;Banta: He probably might have got a lot of applause when he came out.&lt;br /&gt;Santa: He never came out of the cage! &lt;br /&gt;Santa found answer to the most difficult question ever&lt;br /&gt;What comes first the chicken or the egg?&lt;br /&gt;O yaar, jiska order pehle doge, vo ayega! &lt;br /&gt;Teacher to Banta: Where were you born?&lt;br /&gt;Banta : In Tiruvanantapuram.&lt;br /&gt;Teacher : Spell it?&lt;br /&gt;Banta : (after thinking) I think I was born in GOA. &lt;br /&gt;Santa : People consider me as a GOD&lt;br /&gt;Banta : How do you know??&lt;br /&gt;Santa : When I went to the Park today, everybody said, Oh GOD! You have came again. &lt;br /&gt;Santa complained to Police : Sir all items are missing, except the TV in my house.&lt;br /&gt;Police : Why did the thief not take the TV?&lt;br /&gt;Santa : I was watching the TV.</content><link rel='replies' type='application/atom+xml' href='http://gudurin.blogspot.com/feeds/4012302555648737269/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1819512445879631740/4012302555648737269' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1819512445879631740/posts/default/4012302555648737269'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1819512445879631740/posts/default/4012302555648737269'/><link rel='alternate' type='text/html' href='http://gudurin.blogspot.com/2009/08/jokes.html' title='Jokes'/><author><name>Naresh Guduri Blog</name><uri>http://www.blogger.com/profile/02461913656830998473</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1819512445879631740.post-6443815979950904842</id><published>2009-07-03T17:26:00.000-07:00</published><updated>2009-07-03T17:40:25.549-07:00</updated><title type='text'>The ABCs Of Programming Windows Communication Foundation</title><content type='html'>Learn The ABCs Of Programming Windows Communication Foundation&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; The WCF programming model &lt;br /&gt; Defining contracts and behavior &lt;br /&gt; Hosting a service and defining endpoints &lt;br /&gt; Creating and configuring clients  &lt;br /&gt;&lt;br /&gt;THIS ARTICLE USES THE FOLLOWING TECHNOLOGIES: &lt;br /&gt;.NET Framework 2.0, WCF, WSDL, SOAP&lt;br /&gt;&lt;br /&gt;WCF Programming Model &lt;br /&gt;Service Contracts and Dispatch Behavior &lt;br /&gt;Data Contracts &lt;br /&gt;Message and Service Contracts &lt;br /&gt;Implementing Service Contracts &lt;br /&gt;Hosting the Service and Defining Endpoints &lt;br /&gt;Choosing and Customizing Bindings &lt;br /&gt;Opening the Host &lt;br /&gt;Configuring Service Endpoints &lt;br /&gt;Using Activation Services &lt;br /&gt;Programming Clients &lt;br /&gt;Configuring Client Endpoints &lt;br /&gt;Generating Client Proxies &lt;br /&gt;Logging Messages &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Conclusion &lt;br /&gt;Windows® Communication Foundation (WCF), formerly code-named &quot;Indigo,&quot; is about to radically change the face of distributed programming for developers using the Microsoft® .NET Framework. WCF unifies the existing suite of .NET distributed technologies into a single programming model that improves the overall developer experience through a consistent architecture, new levels of functionality and interoperability, and all the extensibility points you could want. This article introduces you to WCF programming and shows you how to get started.&lt;br /&gt;As its name suggests, WCF provides the .NET Framework with a basis for writing code to communicate across components, applications, and systems. WCF was designed according to the tenets of service orientation. A service is a piece of code you interact with through messages. Services are passive. They wait for incoming messages before doing any work. Clients are the initiators. Clients send messages to services to request work.&lt;br /&gt; &lt;a href=&quot;http://1.bp.blogspot.com/_X9QaTYLz7HA/Sk6jFOGIwDI/AAAAAAAAEkA/NIRdFpLP1hk/s1600-h/Untitled1.jpg&quot;&gt;&lt;img style=&quot;float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 265px; height: 110px;&quot; src=&quot;http://1.bp.blogspot.com/_X9QaTYLz7HA/Sk6jFOGIwDI/AAAAAAAAEkA/NIRdFpLP1hk/s320/Untitled1.jpg&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5354396317068607538&quot; /&gt;&lt;/a&gt;&lt;br /&gt; &lt;/br&gt;&lt;br /&gt;&lt;br /&gt;Figure 1 Services and Endpoints &lt;br /&gt;Services expose one or more endpoints where messages can be sent. Each endpoint consists of an address, a binding, and a contract (see Figure 1). The address specifies where to send messages. The binding describes how to send messages. And the contract describes what the messages contain. Clients need to know this information before they can access a service.&lt;br /&gt;Services can package up endpoint descriptions to share with clients, typically by using Web Services Description Language (WSDL). Then clients can use the provided service description to generate code within their environment capable of sending and receiving the proper messages (see Figure 2).&lt;br /&gt; &lt;br /&gt;&lt;a href=&quot;http://3.bp.blogspot.com/_X9QaTYLz7HA/Sk6jAR5FVmI/AAAAAAAAEj0/JxjcmGHrvH0/s1600-h/Untitled.jpg&quot;&gt;&lt;img style=&quot;float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 211px; height: 311px;&quot; src=&quot;http://3.bp.blogspot.com/_X9QaTYLz7HA/Sk6jAR5FVmI/AAAAAAAAEj0/JxjcmGHrvH0/s320/Untitled.jpg&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5354396232188253794&quot; /&gt;&lt;/a&gt;&lt;br /&gt; &lt;/br&gt;&lt;br /&gt;&lt;br /&gt;Figure 2 Sharing Endpoint Descriptions &lt;br /&gt;Windows Communication Foundation provides a new library of classes found in the System.ServiceModel namespace that bring these service-oriented concepts to life. This is what&#39;s typically referred to as the WCF programming model.&lt;br /&gt;&lt;br /&gt;WCF Programming Model&lt;br /&gt;With WCF, you&#39;re either writing services that expose endpoints or you&#39;re writing clients that interact with endpoints. Hence, endpoints are central to the WCF programming model and infrastructure. WCF models endpoints with the .NET classes and interfaces shown in Figure 3. This mapping is true whether you&#39;re writing WCF clients or services.&lt;br /&gt;&lt;br /&gt;  Figure 3 WCF Classes and Interfaces &lt;br /&gt;&lt;br /&gt;Element Class or Interface&lt;br /&gt;Endpoint  System.ServiceModel.ServiceEndpoint&lt;br /&gt;Address System.Uri&lt;br /&gt;Binding System.ServiceModel.Binding &lt;br /&gt;Contract  Interfaces annotated with System.ServiceModel attributes&lt;br /&gt;When building a WCF service, you typically start by defining a .NET interface definition to serve as the service contract. Then you implement the service contract in a .NET class, known as the service type, and configure its behavior. Next, you define the endpoints the service will expose, specifying the address, binding, and contract for each one. Finally, you host the service type in an application using the WCF hosting infrastructure. Once the service type is hosted, clients can retrieve its endpoint descriptions and begin integrating with it.&lt;br /&gt;When building a WCF client, you first need the description of the target endpoint you want to access. The endpoint description can be used to dynamically create a typed proxy. WCF provides a tool named SvcUtil.exe for automating this process. Then you can write code against the typed proxy to access the service by sending the appropriate messages to the target endpoint.&lt;br /&gt;&lt;br /&gt;Service Contracts and Dispatch Behavior&lt;br /&gt;You model service contracts in .NET using traditional C# interface definitions. You can use any .NET interface as a starting point, such as the one shown here: &lt;br /&gt;&lt;br /&gt;namespace ServiceLibrary&lt;br /&gt;{&lt;br /&gt;    public interface IEchoService&lt;br /&gt;    {&lt;br /&gt;        string Echo(string msg);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;To make this a WCF service contract, you must annotate the interface itself with [ServiceContract] and each operation you want to expose with [OperationContract]: &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;using System.ServiceModel;&lt;br /&gt;&lt;br /&gt;namespace ServiceLibrary&lt;br /&gt;{&lt;br /&gt;    [ServiceContract(Namespace=&quot;http://example.org/echo/&quot;)]&lt;br /&gt;    public interface IEchoService&lt;br /&gt;    {&lt;br /&gt;        [OperationContract]&lt;br /&gt;        string Echo(string msg);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;These attributes influence the mapping between the worlds of .NET and SOAP. WCF uses the information found in the service contract to perform dispatching and serialization. Dispatching is the process of deciding which method to call for an incoming SOAP message. Serialization is the process of mapping between the data found in a SOAP message and the corresponding .NET objects used in the method invocation. This mapping is controlled by an operation&#39;s data contract.&lt;br /&gt;WCF dispatches based on the message action. Each method in a service contract is automatically assigned an action value based on the service namespace and method name. For example, the default action for the Echo method just shown is http://example.org/echo/Echo. You can customize the action value for each method using [OperationContract]. A value of * can be used for any action when a specific match doesn&#39;t exist.&lt;br /&gt;In the following example, WCF will dispatch messages with an action of urn:echo:string to the Echo method. Messages with any other action are dispatched to the EchoMessage method: &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;[ServiceContract(Namespace=&quot;http://example.org/echo/&quot;)]&lt;br /&gt;public interface IEchoService&lt;br /&gt;{&lt;br /&gt;    [OperationContract(Action=&quot;urn:echo:string&quot;)]&lt;br /&gt;    string Echo(string msg);&lt;br /&gt;&lt;br /&gt;    [OperationContract(Action=&quot;*&quot;)]&lt;br /&gt;    Message EchoMessage(Message msg);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Data Contracts&lt;br /&gt;Once the target method has been determined based on the action, WCF relies on the method&#39;s data contract to perform serialization. The data contract is defined by the types used in the method signature. In the previous example, EchoMessage is generic and could be used to process a variety of incoming SOAP messages. Therefore I&#39;ve used Message to model the input and output. Message is a special type used to represent all messages flowing through WCF. When using Message, WCF does not perform type-based serialization. Instead, it just gives you direct access to what&#39;s found in the SOAP message.&lt;br /&gt;When Message is not used, WCF performs serialization to map between the data found in the SOAP message and the corresponding .NET objects needed to invoke the method. For example, in the case of Echo, WCF maps the SOAP payload to a .NET string. WCF provides an implicit mapping for all .NET primitive types (string, int, double, and so on).&lt;br /&gt;The way WCF serializes .NET classes depends on the serialization engine in use. The default serialization engine is known as DataContract, a simplified version of XmlSerializer, the default serialization engine used in ASMX today. DataContract defines attributes for annotating class definitions to influence the serialization process. Here&#39;s an example of it in use: &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;[DataContract(Namespace=&quot;http://example.org/person&quot;)]&lt;br /&gt;public class Person&lt;br /&gt;{&lt;br /&gt;    [DataMember(Name=&quot;first&quot;, Order=0)]&lt;br /&gt;    public string First;&lt;br /&gt;    [DataMember(Name=&quot;last&quot;, Order=1)]&lt;br /&gt;    public string Last;&lt;br /&gt;    [DataMember(IsRequired=false, Order=2)]&lt;br /&gt;    private string id;&lt;br /&gt;    ...&lt;br /&gt;}&lt;br /&gt;With DataContract, only fields marked with DataMember will be serialized. And you can serialize private fields. This is much different from the way XmlSerializer works. Now you can use Person in an operation contract: &lt;br /&gt;&lt;br /&gt;[ServiceContract(Namespace=&quot;http://example.org/echo/&quot;)]&lt;br /&gt;public interface IEchoService&lt;br /&gt;{&lt;br /&gt;    ... // previous methods omitted&lt;br /&gt;&lt;br /&gt;    [OperationContract]&lt;br /&gt;    Person EchoPerson(Person p);&lt;br /&gt;}&lt;br /&gt;When EchoPerson is invoked, WCF will serialize Person instances according to the DataContract attributes specified on the Person class. DataContract produces a very simple XML structure—a sequence of elements. You can control the name of each element, the order, and whether a particular element is required, but that&#39;s about it.&lt;br /&gt;If you need to do anything more sophisticated, WCF lets you fall back to using XmlSerializer. You indicate your desire to use XmlSerializer by annotating the interface with [XmlSerializerFormat]: &lt;br /&gt;&lt;br /&gt;[ServiceContract]&lt;br /&gt;[XmlSerializerFormat]&lt;br /&gt;public interface IEchoService { ... }&lt;br /&gt;This tells WCF to use XmlSerializer for all types in the contract, according to the XmlSerializer defaults and the various System.Xml.Serialization customization attributes. This makes it much easier to move existing ASMX services forward to WCF.&lt;br /&gt;WCF also supports serializing types marked with [Serializable], which allows .NET remoting types to work with WCF without change. WCF provides an implicit mapping for [Serializable] types where all public/private fields are automatically serialized.&lt;br /&gt;&lt;br /&gt;Message and Service Contracts&lt;br /&gt;All of the examples up to this point have relied on WCF to automatically map the method signature to the SOAP message. The parameter list and return type are always mapped to the SOAP body for the request and response, respectively. If you need to support headers, you can write another class that models the structure of the entire SOAP envelope for the particular operation, specifying which fields map to headers versus the body. You define this mapping with the [MessageContract] attributes: &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;[MessageContract]&lt;br /&gt;public class EchoPersonMessage&lt;br /&gt;{&lt;br /&gt;    [MessageBody]&lt;br /&gt;    public Person Person;&lt;br /&gt;    [MessageHeader]&lt;br /&gt;    public Authorization Authorization;&lt;br /&gt;}&lt;br /&gt;In this example, the Person field is mapped to the SOAP body while the Authorization field is mapped to a SOAP header. Now you can use EchoPersonMessage in an operation contract: &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;[ServiceContract]&lt;br /&gt;public interface IEchoService&lt;br /&gt;{&lt;br /&gt;    ... // previous methods omitted&lt;br /&gt;&lt;br /&gt;    [OperationContract]&lt;br /&gt;    void EchoPerson(EchoPersonMessage msg);&lt;br /&gt;}&lt;br /&gt;Using MessageContract is a more advanced technique that is only necessary when you need direct control over the SOAP contract.&lt;br /&gt;&lt;br /&gt;Implementing Service Contracts&lt;br /&gt;Now you can implement the service contract by simply implementing the .NET interface in a class: &lt;br /&gt;&lt;br /&gt;using System.ServiceModel;&lt;br /&gt;namespace ServiceLibrary&lt;br /&gt;{&lt;br /&gt;    public class EchoService : IEchoService&lt;br /&gt;    {&lt;br /&gt;        public string Echo(string msg)&lt;br /&gt;        {&lt;br /&gt;            return msg;&lt;br /&gt;        }&lt;br /&gt;        ... // remaining methods omitted&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;By doing this, EchoService is guaranteed to support the service contract defined by IEchoService. When using an interface to define the service contract, you don&#39;t need any contract-related attributes on the class definition. However, you may want to use [ServiceBehavior] to influence its local behavior: &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;using System.ServiceModel;&lt;br /&gt;&lt;br /&gt;namespace ServiceLibrary&lt;br /&gt;{&lt;br /&gt;    ... // interface definition omitted&lt;br /&gt;&lt;br /&gt;    [ServiceBehavior(&lt;br /&gt;       InstanceContextMode=InstanceContextMode.Single,&lt;br /&gt;       ConcurrencyMode=ConcurrencyMode.Multiple)]&lt;br /&gt;    public class EchoService : IEchoService&lt;br /&gt;    {&lt;br /&gt;       ...&lt;br /&gt;This particular example tells WCF to manage a singleton instance of the service type and to allow multithreaded access to the instance. There is also an [OperationBehavior] attribute for controlling operation-level behavior.&lt;br /&gt;Behaviors influence processing within the host, but have no impact on the service contract whatsoever. Behaviors are one of the primary WCF extensibility points. Any class that implements IServiceBehavior can be applied to a service through the use of a custom attribute or configuration element.&lt;br /&gt;&lt;br /&gt;Hosting the Service and Defining Endpoints&lt;br /&gt;To use EchoService, you need to host it in a .NET-based application. The ServiceHost class gives you direct control over the WCF hosting infrastructure. You instantiate ServiceHost based on a particular service type. The following code shows how to do this in a console application: &lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.ServiceModel;&lt;br /&gt;using ServiceLibrary;&lt;br /&gt;&lt;br /&gt;class Program&lt;br /&gt;{&lt;br /&gt;    static void Main(string[] args)&lt;br /&gt;    {&lt;br /&gt;        using (ServiceHost host = new ServiceHost(&lt;br /&gt;            typeof(EchoService), new Uri(&quot;http://localhost:8080/echo&quot;)))&lt;br /&gt;        {&lt;br /&gt;            ...&lt;br /&gt;In addition to specifying the service type, you also specify the base addresses for the different transports you plan to use. In this example, I&#39;ve specified a base address of http://localhost:8080/echo. This will be used as the base for any relative HTTP addresses I might specify when adding endpoints. The base HTTP address is also used as the default for retrieving the service description.&lt;br /&gt;You then add the service endpoints. Again, a service may have one or more endpoints and each endpoint consists of an address, a binding, and a contract. You provide this information to your ServiceHost by calling AddServiceEndpoint. This is where you specify the service contract you defined earlier (IEchoService). For the binding, you typically choose from one of the many predefined bindings that ship with WCF and an appropriate address given the binding&#39;s transport. Here&#39;s an example: &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;host.AddServiceEndpoint(typeof(IEchoService), &lt;br /&gt;    new BasicHttpBinding(), &quot;svc&quot;);&lt;br /&gt;host.AddServiceEndpoint(typeof(IEchoService), &lt;br /&gt;    new NetTcpBinding(), &quot;net.tcp://localhost:8081/echo/svc&quot;);&lt;br /&gt;In this particular example, I&#39;ve specified IEchoService as the contract for both endpoints, but with each endpoint using a different binding and address. The first endpoint uses the BasicHttpBinding and a relative HTTP address of svc (which would make its absolute address http://localhost:8080/echo/svc). The second endpoint uses the NetTcpBinding and an address of net.tcp://localhost:8081/echo/svc. Therefore, this service allows consumers to communicate with it over either HTTP or TCP using different WS-* protocols, as defined by each binding.&lt;br /&gt;&lt;br /&gt;Choosing and Customizing Bindings&lt;br /&gt;The WCF infrastructure relies heavily on endpoint definitions to control how messages are processed. In fact, WCF uses the endpoint definitions to dynamically build the appropriate message processing runtime within hosts and clients. The binding has the most significant influence on this process.&lt;br /&gt;The binding controls three aspects of message communication: the suite of WS-* protocols, including WS-Security, WS-ReliableMessaging, and so on; the message encoding, such as XML 1.0, Message Transmission Optimization Mechanism (MTOM), and binary; and the transport protocol, including HTTP, TCP, and Microsoft Message Queuing (MSMQ). A given binding specifies one message encoding and one transport, but it can specify numerous WS-* protocols. Given that, there are an overwhelming number of permutations that could be used. To simplify things, WCF provides a set of predefined bindings that fit the most common use cases. Figure 4 lists some of these and describes what they embody.&lt;br /&gt;  Figure 4 Predefined WCF Bindings &lt;br /&gt;&lt;br /&gt;Class Name Element Name Transport Encoding WS-* Protocols&lt;br /&gt;BasicHttpBinding  basicHttpBinding HTTP XML 1.0  WS-I Basic Profile 1.1&lt;br /&gt;WSHttpBinding wsHttpBinding HTTP XML 1.0 Message security, reliable sessions, and transactions&lt;br /&gt;WSDualHttpBinding wsDualHttpBinding HTTP XML 1.0 Message security, reliable sessions, and transactions&lt;br /&gt;NetTcpBinding netTcpBinding TCP Binary Transport security, reliable sessions, and transactions&lt;br /&gt;NetNamedPipeBinding  netNamedPipeBinding Named Pipes Binary  Transport security, reliable sessions, and transactions&lt;br /&gt;NetMsmqBinding  netMsmqBinding MSMQ Binary  Transport security and queue transactions&lt;br /&gt;Developers who care primarily about interoperability and don&#39;t need WS-* functionality will typically use BasicHttpBinding. Developers who care about interoperability, but also need message-based security, reliable messaging, and transactions will typically choose WSHttpBinding. Developers using WCF on both sides (client and service) can choose from NetTcpBinding and NetNamedPipeBinding, which provide significant optimizations. Those building asynchronous systems can choose NetMsmqBinding. There are also a few bindings that aren&#39;t listed here, such as MsmqIntegrationBinding for integrating with existing MSMQ applications, NetPeerTcpBinding for building peer-to-peer services, and WSFederationBinding for federated security. A service can support any combination of these bindings.&lt;br /&gt;Once you choose a binding and instantiate it, you can customize some of its characteristics through the properties exposed on the binding class. The following example shows how to enable transport-based security on the BasicHttpBinding: &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;BasicHttpBinding b = new BasicHttpBinding();&lt;br /&gt;b.Security.Mode = BasicHttpSecurityMode.Transport;&lt;br /&gt;b.Security.Transport.ClientCredentialType = &lt;br /&gt;    HttpClientCredentialType.Basic;&lt;br /&gt;host.AddServiceEndpoint(typeof(IEchoService), b, &quot;svc&quot;);&lt;br /&gt;If the predefined bindings and their customizations still don&#39;t fit your needs, you can also write a custom binding by implementing a class that derives from Binding.&lt;br /&gt;&lt;br /&gt;Opening the Host&lt;br /&gt;Now that you&#39;ve configured the host with endpoint information, WCF can build the runtime needed to support your configuration. This occurs when you call Open on a particular ServiceHost: &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;host.Open();&lt;br /&gt;Once the call to Open returns, the WCF runtime is built and ready to receive messages at the addresses specified by each endpoint. During this process, WCF generates an endpoint listener for each supplied endpoint and the code needed to support the WS-* protocols specified by the binding. (An endpoint listener is the piece of code that actually listens for incoming messages using the specified transport and address.)&lt;br /&gt;You can retrieve information about the service at run time through the object model exposed by ServiceHost. This allows you to retrieve anything you might want to know about the initialized service, such as what endpoints it exposes and what endpoint listeners are currently active.&lt;br /&gt;Figure 5 shows a complete example of the console application that hosts EchoService. Figure 6 shows the output. Notice there are two additional endpoint listener addresses that I didn&#39;t specify in a ServiceEndpoint. WCF automatically provided these using the base HTTP address for retrieving the service description.&lt;br /&gt;  Figure 5 Console App Hosting EchoService &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;class Program&lt;br /&gt;{&lt;br /&gt;    static void Main(string[] args)&lt;br /&gt;    {&lt;br /&gt;        using (ServiceHost host = new ServiceHost(&lt;br /&gt;            typeof(EchoService), new Uri(&quot;http://localhost:8080/echo&quot;)))&lt;br /&gt;        {&lt;br /&gt;            // define the service endpoints&lt;br /&gt;            host.AddServiceEndpoint(typeof(IEchoService), &lt;br /&gt;                new BasicHttpBinding(), &quot;svc&quot;);&lt;br /&gt;            host.AddServiceEndpoint(typeof(IEchoService), &lt;br /&gt;                new NetTcpBinding(), &quot;net.tcp://localhost:8081/echo/svc&quot;);&lt;br /&gt;            host.Open();&lt;br /&gt;&lt;br /&gt;            Console.WriteLine(&lt;br /&gt;                &quot;{0} is open and has the following endpoints:\n&quot;,&lt;br /&gt;                host.Description.ServiceType);&lt;br /&gt;&lt;br /&gt;            int i=1;&lt;br /&gt;            foreach (ServiceEndpoint end in host.Description.Endpoints)&lt;br /&gt;            {&lt;br /&gt;                Console.WriteLine(&quot;Endpoint #{0}&quot;, i++);&lt;br /&gt;                Console.WriteLine(&quot;Address: {0}&quot;, &lt;br /&gt;                    end.Address.Uri.AbsoluteUri);&lt;br /&gt;                Console.WriteLine(&quot;Binding: {0}&quot;, &lt;br /&gt;                    end.Binding.Name);&lt;br /&gt;                Console.WriteLine(&quot;Contract: {0}\n&quot;, &lt;br /&gt;                    end.Contract.Name);&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            Console.WriteLine(&lt;br /&gt;                &quot;The following EndpointListeners are active:\n&quot;);&lt;br /&gt;            foreach (EndpointListener l in host.EndpointListeners)&lt;br /&gt;                Console.WriteLine(l.Listener.Uri.AbsoluteUri);&lt;br /&gt;&lt;br /&gt;            // keep the process alive&lt;br /&gt;            Console.ReadLine();&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;Figure 6 Output of Console App &lt;br /&gt;If you browse to http://localhost:8080/echo, you&#39;ll see the default WCF help page (see Figure 7) and if you browse to http://localhost:8080/echo?wsdl, you&#39;ll see the generated WSDL definition. The other endpoint listener (http://localhost:8080/echo/mex) knows how to speak WS-MetadataExchange. It&#39;s important to note that this sample is not using IIS in any way. WCF provides built-in integration with httpsys, which allows any application to automatically become an HTTP listener.&lt;br /&gt; &lt;br /&gt;Figure 7 EchoService Help Page &lt;br /&gt;&lt;br /&gt;Configuring Service Endpoints&lt;br /&gt;Hardcoding endpoint information into the host application is not ideal since endpoint details may change over time. It&#39;s not hard to imagine how you could store the endpoint information in a configuration file or database and read it while initializing ServiceHost. Since this is a common need, WCF automatically provides this functionality through the predefined &lt;system.serviceModel&gt; configuration section.&lt;br /&gt;The following configuration file defines the same two endpoints that were specified by calling AddServiceEndpoint: &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;configuration&gt;&lt;br /&gt;  &lt;system.serviceModel&gt;&lt;br /&gt;    &lt;services&gt;&lt;br /&gt;      &lt;service type=&quot;ServiceLibrary.EchoService&quot;&gt;&lt;br /&gt;        &lt;endpoint address=&quot;svc&quot; binding=&quot;basicHttpBinding&quot; &lt;br /&gt;                  contract=&quot;ServiceLibrary.IEchoService&quot;/&gt;&lt;br /&gt;        &lt;endpoint address=&quot;net.tcp://localhost:8081/echo/svc&quot;&lt;br /&gt;                  binding=&quot;netTcpBinding&quot; &lt;br /&gt;                  contract=&quot;ServiceLibrary.IEchoService&quot;/&gt;&lt;br /&gt;      &lt;/service&gt;&lt;br /&gt;    &lt;/services&gt;&lt;br /&gt;  &lt;/system.serviceModel&gt;&lt;br /&gt;&lt;/configuration&gt;&lt;br /&gt;If you add this configuration file to the host application shown in Figure 5 and comment out the calls to AddServiceEndpoint, you&#39;ll see the same results in the output. This increases deployment flexibility since the communication details are completely factored out of the compiled code. You can also configure bindings within &lt;system.serviceModel&gt;. Figure 8 shows how to configure basicHttpBinding to use transport security like I had done in code.&lt;br /&gt;  Figure 8 Configuring Transport Security &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;configuration&gt;&lt;br /&gt;  &lt;system.serviceModel&gt;&lt;br /&gt;    &lt;services&gt;&lt;br /&gt;      &lt;service type=&quot;ServiceLibrary.EchoService&quot;&gt;&lt;br /&gt;        &lt;endpoint&lt;br /&gt;          address=&quot;https://localhost:8082/echo/svc&quot;&lt;br /&gt;          binding=&quot;basicHttpBinding&quot;&lt;br /&gt;          bindingConfiguration=&quot;MyBindingConfiguration&quot; &lt;br /&gt;          contract=&quot;ServiceLibrary.IEchoService&quot;/&gt;&lt;br /&gt;        ...&lt;br /&gt;      &lt;/service&gt;&lt;br /&gt;    &lt;/services&gt;&lt;br /&gt;    &lt;bindings&gt;&lt;br /&gt;      &lt;basicHttpBinding&gt;&lt;br /&gt;        &lt;binding name=&quot;MyBindingConfiguration&quot;&gt;&lt;br /&gt;          &lt;security mode=&quot;Transport&quot;&gt;&lt;br /&gt;            &lt;transport clientCredentialType=&quot;Basic&quot; /&gt;&lt;br /&gt;          &lt;/security&gt;&lt;br /&gt;        &lt;/binding&gt;&lt;br /&gt;      &lt;/basicHttpBinding&gt;&lt;br /&gt;    &lt;/bindings&gt;&lt;br /&gt;  &lt;/system.serviceModel&gt;&lt;br /&gt;&lt;/configuration&gt;&lt;br /&gt;You can even define new custom bindings from scratch using the &lt;customBinding&gt; element, which would be equivalent to deriving a new class from Binding. When it comes to configuring endpoints, bindings, and even behaviors, anything you can do in code, you can also do through configuration.&lt;br /&gt; &lt;br /&gt;Figure 9 Using the GUI to Define an Endpoint &lt;br /&gt;Although IntelliSense® for the configuration file works well in Visual Studio® 2005, some developers still prefer to avoid XML altogether. The WinFX® SDK includes a tool called SvcConfigEditor, which provides a graphical interface for working with the various &lt;system.serviceModel&gt; settings. Figure 9 shows how to configure endpoints using this tool.&lt;br /&gt;&lt;br /&gt;Using Activation Services&lt;br /&gt;Although I&#39;ve been experimenting with console applications, ServiceHost makes it easy to host WCF services in a variety of applications, including Windows Forms applications and managed Windows Services. In all of these application scenarios, you&#39;re responsible for managing the process hosting WCF. This is known as self-hosting in WCF terms.&lt;br /&gt;In addition to self-hosting, WCF also makes it possible to activate services by using IIS along with traditional Web hosting techniques. You can accomplish this by using a .svc file (similar to .asmx) that specifies the service type to host: &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;%@Service class=&quot;ServiceLibrary.EchoService&quot; %&gt;&lt;br /&gt;You place this file in a virtual directory and deploy your service type to its \bin directory or the Global Assembly Cache (GAC). When using this technique you specify the service endpoint in the web.config, but you don&#39;t need to specify the address since it&#39;s implied by the location of the .svc file. &lt;br /&gt;&lt;br /&gt;&lt;configuration&gt;&lt;br /&gt;  &lt;system.serviceModel&gt;&lt;br /&gt;    &lt;services&gt;&lt;br /&gt;      &lt;service type=&quot;ServiceLibrary.EchoService&quot;&gt;&lt;br /&gt;        &lt;endpoint address=&quot;&quot; binding=&quot;basicHttpBinding&quot; &lt;br /&gt;          contract=&quot;ServiceLibrary.IEchoService&quot;/&gt;&lt;br /&gt;      &lt;/service&gt;&lt;br /&gt;      ...&lt;br /&gt;Now if you browse to the .svc file, you&#39;ll notice the help page is displayed, showing that a ServiceHost was automatically created within an ASP.NET application domain. This is accomplished by an HTTP module that filters incoming .svc requests and automatically builds and opens the appropriate ServiceHost when needed.&lt;br /&gt;If you install the WinFX extensions for Visual Studio 2005, you&#39;ll find a new Web Site project template called Indigo Service (this name will change). When you create a new Web site based on this template, it automatically gives you the .svc file along with the corresponding implementation class (found in App_Code). It also comes with a default endpoint configuration in web.config.&lt;br /&gt;On IIS versions 5.1 and 6.0 the WCF activation model is tied to the ASP.NET pipeline, and therefore to HTTP. IIS 7.0, which is planned for release with Windows Vista™, introduces a transport-neutral activation mechanism known as Windows Activation Services (WAS). With WAS, you&#39;ll be able to leverage .svc-like activation over any transport.&lt;br /&gt;&lt;br /&gt;Programming Clients&lt;br /&gt;Programming WCF clients involves sending messages to a service endpoint according to its address, binding, and contract. To accomplish this, you first create a ServiceEndpoint representing the target endpoint. The following example shows how to create a ServiceEndpoint, based on the service&#39;s HTTP endpoint, in a client console application: &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.ServiceModel;&lt;br /&gt;using ServiceLibrary;&lt;br /&gt;&lt;br /&gt;class Program&lt;br /&gt;{&lt;br /&gt;    static void Main(string[] args)&lt;br /&gt;    {&lt;br /&gt;        ServiceEndpoint httpEndpoint = new ServiceEndpoint(&lt;br /&gt;            ContractDescription.GetContract(typeof(IEchoService)),&lt;br /&gt;            new BasicHttpBinding(), new EndpointAddress(&lt;br /&gt;                &quot;http://localhost:8080/echo/svc&quot;);&lt;br /&gt;This code assumes that the client has access to the same IEchoService interface definition that the service used and that the client knows what binding and address to use. Then you can create a ChannelFactory based on the ServiceEndpoint: &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;ChannelFactory&lt;IEchoService&gt; factory =&lt;br /&gt;    new ChannelFactory&lt;IEchoService&gt;(httpEndpoint);&lt;br /&gt;ChannelFactory creates typed proxies. In this case, it creates proxies of type IEchoService, which you can use to invoke the operations defined by the contract: &lt;br /&gt;&lt;br /&gt;Copy Code&lt;br /&gt;IEchoService svc = factory.CreateChannel();&lt;br /&gt;Console.WriteLine(svc.Echo(&quot;Hello, world&quot;));&lt;br /&gt;If the service requires a customized binding, you will need to create the binding and customize it before creating ServiceEndpoint. If you want to access the TCP endpoint, simply create another ServiceEndpoint specifying the TCP endpoint details and supply it to ChannelFactory instead of the HTTP endpoint. Everything else would work the same.&lt;br /&gt;The proxy shields you from the different addresses and bindings in use, allowing you to write application code against the service contract. Figure 10 shows the complete client console application.&lt;br /&gt;  Figure 10 EchoService Client App &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;using System;    &lt;br /&gt;using System.ServiceModel;&lt;br /&gt;using ServiceLibrary;&lt;br /&gt;&lt;br /&gt;class Program&lt;br /&gt;{&lt;br /&gt;    static void Main(string[] args)&lt;br /&gt;    {&lt;br /&gt;        try&lt;br /&gt;        {&lt;br /&gt;            // define service endpoints on client&lt;br /&gt;            ServiceEndpoint httpEndpoint = new ServiceEndpoint(&lt;br /&gt;                ContractDescription.GetContract(&lt;br /&gt;                   typeof(IEchoService)),new BasicHttpBinding(),&lt;br /&gt;                new EndpointAddress(&quot;http://localhost:8080/echo/svc&quot;));&lt;br /&gt;&lt;br /&gt;            ServiceEndpoint tcpEndpoint= new ServiceEndpoint(&lt;br /&gt;                ContractDescription.GetContract(&lt;br /&gt;                   typeof(IEchoService)),&lt;br /&gt;                new NetTcpBinding(), new EndpointAddress(&lt;br /&gt;                   &quot;net.tcp://localhost:8081/echo/svc&quot;));&lt;br /&gt;&lt;br /&gt;            IEchoService svc = null;&lt;br /&gt;&lt;br /&gt;            // create channel factory based on HTTP endpoint&lt;br /&gt;            using (ChannelFactory&lt;IEchoService&gt; httpFactory = &lt;br /&gt;                new ChannelFactory&lt;IEchoService&gt;(httpEndpoint))&lt;br /&gt;            {&lt;br /&gt;                // create channel proxy for endpoint&lt;br /&gt;                svc = httpFactory.CreateChannel();&lt;br /&gt;                // invoke service operation&lt;br /&gt;                Console.WriteLine(&quot;Invoking HTTP endpoint: {0}&quot;,&lt;br /&gt;                    svc.Echo(&quot;Hello, world&quot;));&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            // create channel factory based on TCP endpoint&lt;br /&gt;            using (ChannelFactory&lt;IEchoService&gt; tcpFactory =&lt;br /&gt;                new ChannelFactory&lt;IEchoService&gt;(tcpEndpoint))&lt;br /&gt;            {&lt;br /&gt;                // create channel proxy for endpoint&lt;br /&gt;                svc = tcpFactory.CreateChannel();&lt;br /&gt;                // invoke service operation&lt;br /&gt;                Console.WriteLine(&quot;Invoking TCP endpoint: {0}&quot;,&lt;br /&gt;                    svc.Echo(&quot;Hello, world&quot;));&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;        catch (Exception e)&lt;br /&gt;        {&lt;br /&gt;            Console.WriteLine(e);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Configuring Client Endpoints&lt;br /&gt;Hardcoding endpoint information into client code is also less than ideal. So WCF provides a similar configuration mechanism for specifying client endpoints within &lt;system.serviceModel&gt;. The following application configuration file specifies the same client endpoint details used in the code: &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;configuration&gt;&lt;br /&gt;  &lt;system.serviceModel&gt;&lt;br /&gt;    &lt;client&gt;&lt;br /&gt;      &lt;endpoint name=&quot;httpEndpoint&quot; &lt;br /&gt;        address=&quot;http://localhost:8080/echo/svc&quot;&lt;br /&gt;        binding=&quot;basicHttpBinding&quot;&lt;br /&gt;        contract=&quot;ServiceLibrary.IEchoService&quot;/&gt;&lt;br /&gt;      &lt;endpoint name=&quot;tcpEndpoint&quot; &lt;br /&gt;        address=&quot;net.tcp://localhost:8081/echo/svc&quot;&lt;br /&gt;        binding=&quot;netTcpBinding&quot;&lt;br /&gt;        contract=&quot;ServiceLibrary.IEchoService&quot;/&gt;&lt;br /&gt;    &lt;/client&gt;&lt;br /&gt;  &lt;/system.serviceModel&gt;&lt;br /&gt;&lt;/configuration&gt;&lt;br /&gt;Notice that I&#39;ve given each client endpoint a name. You can use this name in your code when creating a ChannelFactory, as illustrated in the following code: &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;using (ChannelFactory&lt;IEchoService&gt; httpFactory = &lt;br /&gt;    new ChannelFactory&lt;IEchoService&gt;(&quot;httpEndpoint&quot;))&lt;br /&gt;{&lt;br /&gt;    svc = httpFactory.CreateChannel();&lt;br /&gt;    Console.WriteLine(&quot;Invoking HTTP endpoint: {0}&quot;,&lt;br /&gt;        svc.Echo(&quot;Hello, world&quot;));&lt;br /&gt;}&lt;br /&gt;Now when you want to create a ChannelFactory for the TCP endpoint, you can simply change the configuration name to tcpEndpoint. You can also configure bindings in the client configuration file just like I did in the service configuration file.&lt;br /&gt;If you add this configuration file to the client console application shown in Figure 10, comment out the code to create the ServiceEndpoint objects, and specify the endpoint names when constructing each ChannelFactory, the result will be the same.&lt;br /&gt;&lt;br /&gt;Generating Client Proxies&lt;br /&gt;The preceding examples assumed the client had access to the same interface definition used to implement the service. This is common when .NET is used to implement both sides (in traditional .NET remoting scenarios), but that&#39;s not always the case, and it&#39;s never the case when the service wasn&#39;t implemented with the .NET Framework. The preceding examples also assumed the client knew the precise endpoint details in advance, which isn&#39;t always common either.&lt;br /&gt;When clients don&#39;t have access to such information, they can discover it using the WS-MetadataExchange specification. Services share endpoint descriptions with clients through WSDL definitions. Most service platforms provide tools for generating client-side code from WSDL definitions. The WinFX SDK provides SvcUtil.exe for this purpose.&lt;br /&gt;When executing SvcUtil.exe, you specify the URL of the WSDL definition and it will generate the necessary .NET code and configuration elements that define the endpoints and bindings used by the service endpoints. Figure 11 shows the output of running SvcUtil.exe against http://localhost:8080/echo. Notice that it generates two files: EchoService.cs and output.config.&lt;br /&gt; &lt;br /&gt;Figure 11 SvcUtil.exe Output &lt;br /&gt;EchoService.cs contains a .NET interface definition equivalent to the one the service implemented. Output.config contains the client endpoint information needed to access the service (similar to what I just wrote manually). You&#39;ll need to merge the contents of output.config with your application configuration file manually. With this in place, you can write client code using the same techniques shown in the previous examples, only using the generated interface and configuration file.&lt;br /&gt;In general, the WCF client programming model is explicit about the service boundary. You create a typed channel against a specific service endpoint and then send messages through it. Although this helps emphasize the tenets of service orientation, it can be tedious to work at this level all the time. To help you, SvcUtil.exe also generates a proxy class that completely hides the ChannelFactory and ServiceEndpoint creation details. If you open EchoService.cs, you&#39;ll find the following class definition: &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public partial class EchoServiceProxy : &lt;br /&gt;   System.ServiceModel.ClientBase&lt;IEchoService&gt;, IEchoService&lt;br /&gt;{&lt;br /&gt;    public EchoServiceProxy()&lt;br /&gt;    {&lt;br /&gt;    }    &lt;br /&gt;    public EchoServiceProxy(string endpointConfigurationName) : &lt;br /&gt;            base(endpointConfigurationName)&lt;br /&gt;    {&lt;br /&gt;    }&lt;br /&gt;...&lt;br /&gt;This proxy class can simplify your client application code. All you have to do is instantiate the proxy, specify the name of the endpoint configuration, and make method calls. Here&#39;s an example: &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;using (EchoServiceProxy proxy = new EchoServiceProxy(&quot;IEchoService&quot;))&lt;br /&gt;{&lt;br /&gt;    // invoke service operation&lt;br /&gt;    Console.WriteLine(&quot;Invoking HTTP endpoint: {0}&quot;,&lt;br /&gt;        proxy.Echo(&quot;Hello, world&quot;));&lt;br /&gt;}&lt;br /&gt;using (EchoServiceProxy proxy = new EchoServiceProxy(&quot;IEchoService1&quot;))&lt;br /&gt;{&lt;br /&gt;    // invoke service operation&lt;br /&gt;    Console.WriteLine(&quot;Invoking TCP endpoint: {0}&quot;,&lt;br /&gt;        proxy.Echo(&quot;Hello, world&quot;));&lt;br /&gt;}&lt;br /&gt;The generated configuration file (output.config) defines the IEchoService and IEchoService1 endpoint configurations.&lt;br /&gt;&lt;br /&gt;Logging Messages&lt;br /&gt;As you begin working with the WCF programming model, you may find it useful to trace the SOAP messages traveling between clients and services. Windows Communication Foundation provides built-in support for message logging, which can be turned on through your application configuration file.&lt;br /&gt; &lt;br /&gt;Figure 12 SvcTraceViewer.exe &lt;br /&gt;SvcConfigEditor provides a Diagnostics tab where you can enable the messaging logging features. Once you enable messaging logging and rerun the app, you&#39;ll see the trace file appear in the specified location. The WinFX SDK also provides SvcTraceViewer.exe for viewing the information in a trace file (see Figure 12).&lt;br /&gt;&lt;br /&gt;Conclusion&lt;br /&gt;WCF is a new step in distributed programming for developers using the .NET Framework. If you currently build systems using any of today&#39;s .NET distributed technologies, it&#39;s time to start paying attention to WCF and the future it holds. It&#39;s only a matter of time before all .NET-targeted code related to communications will be written using WCF.</content><link rel='replies' type='application/atom+xml' href='http://gudurin.blogspot.com/feeds/6443815979950904842/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1819512445879631740/6443815979950904842' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1819512445879631740/posts/default/6443815979950904842'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1819512445879631740/posts/default/6443815979950904842'/><link rel='alternate' type='text/html' href='http://gudurin.blogspot.com/2009/07/abcs-of-programming-windows.html' title='The ABCs Of Programming Windows Communication Foundation'/><author><name>Naresh Guduri Blog</name><uri>http://www.blogger.com/profile/02461913656830998473</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_X9QaTYLz7HA/Sk6jFOGIwDI/AAAAAAAAEkA/NIRdFpLP1hk/s72-c/Untitled1.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1819512445879631740.post-3848990251997148030</id><published>2009-07-02T22:59:00.001-07:00</published><updated>2009-07-02T22:59:40.162-07:00</updated><title type='text'>North Indian Wife Vs South Indian Wife ( EVERYONE SHOUD READ)</title><content type='html'>*** WHAT IT MEANS TO HAVE A North Indian GIRL as WIFE ***&lt;br /&gt;&lt;br /&gt;1. At the time of marriage, a north Indian girl has more boyfriends&lt;br /&gt;than her age.&lt;br /&gt;&lt;br /&gt;2. Before marriage, she looks almost like a bollywood heroine and&lt;br /&gt;after marriage you have to go around her twice to completely hug&lt;br /&gt;her.&lt;br /&gt;&lt;br /&gt;3. By the time she professes her undevoted love to you, you are&lt;br /&gt;bankrupt because of the number of times you had to take her out&lt;br /&gt;to movies, theatres and restaurants. And you wait longingly for her&lt;br /&gt;dowry.&lt;br /&gt;&lt;br /&gt;4. The only dishes she can think of to cook is paneer butter&lt;br /&gt;masala, aloo sabji, aloo Gobi sabji, aloo matar, aloo paneer, that&lt;br /&gt;after eating all those paneer and aloos you are either in the bed&lt;br /&gt;with chronic cholestrol or chronic gas disorder.&lt;br /&gt;&lt;br /&gt;5. The only growth that you see later in your career is the rise in your monthly phone bill.&lt;br /&gt;&lt;br /&gt;6. You are blinded by her love that you think that she is a blonde.&lt;br /&gt;Only later do you come to know that it is because of the mehandhi&lt;br /&gt;that she applies to cover her grey hair.&lt;br /&gt;&lt;br /&gt;7. When you come home from office she is very busy watching&lt;br /&gt;&quot;Kyonki saas bhi kabi bahu thi&quot; that you either end up eating&lt;br /&gt;outside or cooking yourself.&lt;br /&gt;&lt;br /&gt;8. You are a very &quot;ESpecial&quot; person to her.&lt;br /&gt;&lt;br /&gt;9. She always thought that Madras is a state and covers the whole&lt;br /&gt;of south India until she met you.&lt;br /&gt;&lt;br /&gt;10. When she says she is going to &quot;work out&quot; she means she is&lt;br /&gt;going to &quot; walk out&quot;&lt;br /&gt;&lt;br /&gt;11. She has greater number of relatives than the number of people&lt;br /&gt;you have in your home town.&lt;br /&gt;&lt;br /&gt;12. The only two sentences in English that she knows are &quot;Thank&lt;br /&gt;you&quot; and &quot;How are you&quot;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;*** WHAT IT MEANS TO HAVE A South Indian GIRL as WIFE&lt;br /&gt;***&lt;br /&gt;&lt;br /&gt;1.Her mother looks down at you because you didn&#39;t study in IIT or&lt;br /&gt;Madras / Anna University .&lt;br /&gt;&lt;br /&gt;2. Her father starts or ends every conversation with &quot; ... I say...&quot;&lt;br /&gt;&lt;br /&gt;3. She shudders if you use four letter words.&lt;br /&gt;&lt;br /&gt;4. She has long hair, neatly oiled and braided (The Dubai based Oil&lt;br /&gt;Well Company will negotiate with her on a 25 year contract to&lt;br /&gt;extract coconut oil from her hair.)&lt;br /&gt;&lt;br /&gt;5. She uses the word &#39;Super&#39; as her only superlative.&lt;br /&gt;&lt;br /&gt;6. Her name is another name for a Goddess or a flower.&lt;br /&gt;&lt;br /&gt;7. Her first name is longer than your first name, middle name and&lt;br /&gt;surname combined (unless you are from Andhra)&lt;br /&gt;&lt;br /&gt;8. When she mixes milk/curd and rice you are never sure whether it&lt;br /&gt;is for the dog or for herself.&lt;br /&gt;&lt;br /&gt;9. For weddings, she sports a mini jasmine garden on her head and&lt;br /&gt;wears silk saris in the Madras heat without looking too&lt;br /&gt;uncomfortable while you are melting in your singlet.&lt;br /&gt;&lt;br /&gt;10. Her favourite cricketer is Krishnamachari Srikkanth.&lt;br /&gt;&lt;br /&gt;11. Her favourite food is dosa though she has tried North Indian&lt;br /&gt;snacks like Chats (pronounced like the slang for &#39;conversation&#39;)&lt;br /&gt;&lt;br /&gt;12. She bores you by telling you which raaga each song you hear is&lt;br /&gt;based on.&lt;br /&gt;&lt;br /&gt;13. You have to give her jewellery, though she has already got&lt;br /&gt;plenty of it ..&lt;br /&gt;&lt;br /&gt;14. Her Mangal Sutra weighs more than the championship belts&lt;br /&gt;worn by WWF wrestlers.&lt;br /&gt;&lt;br /&gt;15. Her father thinks she is much smarter than you.</content><link rel='replies' type='application/atom+xml' href='http://gudurin.blogspot.com/feeds/3848990251997148030/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1819512445879631740/3848990251997148030' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1819512445879631740/posts/default/3848990251997148030'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1819512445879631740/posts/default/3848990251997148030'/><link rel='alternate' type='text/html' href='http://gudurin.blogspot.com/2009/07/north-indian-wife-vs-south-indian-wife.html' title='North Indian Wife Vs South Indian Wife ( EVERYONE SHOUD READ)'/><author><name>Naresh Guduri Blog</name><uri>http://www.blogger.com/profile/02461913656830998473</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1819512445879631740.post-8880498553063296558</id><published>2009-07-02T22:49:00.000-07:00</published><updated>2009-07-02T22:52:13.930-07:00</updated><title type='text'>Jokes</title><content type='html'>&lt;span style=&quot;font-weight:bold;&quot;&gt;Sardars Funny Collection&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Sardar: My mobile bill how much?&lt;br /&gt;Call centre girl: sir, just dial 123to know current bill status&lt;br /&gt;Sardar: Stupid, not CURRENT BILL my MOBILE BILL.&lt;br /&gt;*****************************************&lt;br /&gt;Sardar built 2 Swimming Pools. And he left one of them unfilled y?&lt;br /&gt;When asked him, he said,&lt;br /&gt;&quot;Oye, that’s for those who don’t know Swimming.&lt;br /&gt;*****************************************&lt;br /&gt;A sardarji Doctor falls in Love with a Nurse.He writes a love letter&lt;br /&gt;to the Nurse :- I Love U sister...&lt;br /&gt;****************************&lt;br /&gt;Sardar: I think that girl is deaf..&lt;br /&gt;Friend: How do u know?&lt;br /&gt;Sardar: I told I Love her, but she said her chappals are new&lt;br /&gt;******************************************&lt;br /&gt;Judge: Don&#39;t U have shame? It is d 3rd time U R coming to court.&lt;br /&gt;Sardar to judge: U R coming daily, don&#39;t U have shame?&lt;br /&gt;*****************************************&lt;br /&gt;Sardar in airplane going 2 Bombay .. While its landing he shouted: &quot;&lt;br /&gt;Bombay ... Bombay &quot;&lt;br /&gt;Air hostess said: &quot;B silent.&quot;&lt;br /&gt;Sardar: &quot;Ok. Ombay. Ombay&quot;&lt;br /&gt;*****************************&lt;br /&gt;Sardar got a sms from his girl friend:&lt;br /&gt;&quot;I MISS YOU&quot;&lt;br /&gt;Sardarji replied:&lt;br /&gt;&quot;I Mr YOU&quot; !!.&lt;br /&gt;**************************&lt;br /&gt;Sardar: Doctor! My Son swallowed a key&lt;br /&gt;Doctor: When?&lt;br /&gt;Sardar: 3 Months Ago&lt;br /&gt;Dr: Wat were u doing till now?&lt;br /&gt;Sardar: We were using duplicate key&lt;br /&gt;Dr: So why did you come today?&lt;br /&gt;Sardar: We lost the duplicate key!!&lt;br /&gt;*******************************&lt;br /&gt;&lt;br /&gt;After finishing MBBS Sardar started his practice.&lt;br /&gt;He Checked 1st Patient&#39;s Eyes, Tongue &amp; Ears with a Torch &amp; Finally Said:&lt;br /&gt;&quot;Oye, Torch is okay&quot;&lt;br /&gt;)))))))))))))))))))))))))))))))))))))))))))))))))) ))&lt;br /&gt;Teacher: &quot;What is common between JESUS, RAM, GANDHI and BUDHA?&quot;&lt;br /&gt;Sardar: &quot;All are born on government holidays...!!!</content><link rel='replies' type='application/atom+xml' href='http://gudurin.blogspot.com/feeds/8880498553063296558/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1819512445879631740/8880498553063296558' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1819512445879631740/posts/default/8880498553063296558'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1819512445879631740/posts/default/8880498553063296558'/><link rel='alternate' type='text/html' href='http://gudurin.blogspot.com/2009/07/jokes.html' title='Jokes'/><author><name>Naresh Guduri Blog</name><uri>http://www.blogger.com/profile/02461913656830998473</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1819512445879631740.post-96344752446917635</id><published>2009-07-02T06:03:00.000-07:00</published><updated>2009-07-02T06:09:09.062-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="# serialization"/><category scheme="http://www.blogger.com/atom/ns#" term="C#3.0"/><title type='text'>C# serialzation</title><content type='html'>&lt;div&gt;Binary Serialization&lt;br /&gt;1. Which class is responsible for binary serialization?&lt;br /&gt;&lt;br /&gt;The BinaryFormater is the class responsible for the binary serialization and It&#39;s commonly used for the .Net Remoting.&lt;br /&gt;2. What does it take to make my object serializable?&lt;br /&gt;&lt;br /&gt;Your class must have the attribute SerializableAttribute and all its members must also be serializable, except if they are ignored with the attribute NonSerializedAttribute. Private and public fields are serialized by default.&lt;br /&gt;[Serializable]&lt;br /&gt;public class Invoice {&lt;br /&gt;private string clientName;&lt;br /&gt;private DateTime date;&lt;br /&gt;private double total;&lt;br /&gt;&lt;br /&gt;[NonSerialized]&lt;br /&gt;private string internalCode;&lt;br /&gt;&lt;br /&gt;public string ClientName {&lt;br /&gt;get {&lt;br /&gt;return clientName;&lt;br /&gt;}&lt;br /&gt;set {&lt;br /&gt;clientName = value;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public DateTime Date {&lt;br /&gt;get {&lt;br /&gt;return date;&lt;br /&gt;}&lt;br /&gt;set {&lt;br /&gt;date = value;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public String Tag {&lt;br /&gt;get {&lt;br /&gt;return tag;&lt;br /&gt;}&lt;br /&gt;set {&lt;br /&gt;tag = value;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public double Total {&lt;br /&gt;get {&lt;br /&gt;return total;&lt;br /&gt;}&lt;br /&gt;set {&lt;br /&gt;total = value;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;3. What are the main advantages of binary serialization?&lt;br /&gt;• Smaller&lt;br /&gt;• Faster&lt;br /&gt;• More powerful (support complex objects and read only properties)&lt;br /&gt;4. How do you encapsulate the binary serialization?&lt;br /&gt;public static void SerializeBinary( object aObject, string aFileName) {&lt;br /&gt;using (FileStream _FileStream = new FileStream(aFileName, FileMode.Create)) {&lt;br /&gt;BinaryFormatter _Formatter = new BinaryFormatter ();&lt;br /&gt;_Formatter.Serialize(_FileStream, aObject);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;5. How do you encapsulate the binary deserialization method?&lt;br /&gt;public static object DeserializeBinary(string aFileName) {&lt;br /&gt;using (FileStream _FileStream = new FileStream(aFileName, FileMode.Open)) {&lt;br /&gt;BinaryFormatter _Formatter = new BinaryFormatter ();&lt;br /&gt;return _Formatter.Deserialize(_FileStream);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;6. Will my read only properties be serialized?&lt;br /&gt;&lt;br /&gt;Yes if the properties encapsulate a field. By default all the private and public fields are serialized. Binary serialization is not related to properties.&lt;br /&gt;7. Is it possible to have circular reference?&lt;br /&gt;&lt;br /&gt;Yes it is, you can have circular reference and the binary serialization process will work fine. .Net generate the object graph before the executing the serialization and finally generate the stream. Unlike Xml serialization process, the BinaryFormater has no problem with the circular reference.&lt;br /&gt;8. Why my Dataset is so big when it&#39;s serialized in binary?&lt;br /&gt;&lt;br /&gt;By default the DataSet is serialized in Xml and the binary stream only wraps the Xml Data inside it. That&#39;s mean that the size is similar to the Xml size. .Net 2.0 add a new property named RemotingFormat used to change the binary serialization format of the DataSet. SerializationFormat.Binary will generate a better result.&lt;br /&gt;For previous version, it&#39;s also possible to download the DataSetSurrogate to reduce the size and increase the performance.&lt;br /&gt;9. How do I serialize a Dataset in binary?&lt;br /&gt;&lt;br /&gt;See answer above.&lt;br /&gt;&lt;br /&gt;10. How can I implement a custom serialization?&lt;br /&gt;&lt;br /&gt;If you need to control the serialization process of your class, you can implement the ISerializable interface which contains a method GetObjectData and a special constructor . Why use custom serialization ? By using it you will be able to handle version change in your class or get a better performance result. An exception of type SerializationException is raised if the fields does not exists.&lt;br /&gt;#region ISerializable Members&lt;br /&gt;&lt;br /&gt;//Special constructor&lt;br /&gt;protected CustomInvoice(SerializationInfo info, StreamingContext context) {&lt;br /&gt;clientName = info.GetString(&quot;clientName&quot;);&lt;br /&gt;date = info.GetDateTime(&quot;date&quot;);&lt;br /&gt;total = info.GetDouble(&quot;total&quot;);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;[SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)]&lt;br /&gt;public void GetObjectData(SerializationInfo info, StreamingContext context) {&lt;br /&gt;info.AddValue(&quot;clientName&quot;, clientName);&lt;br /&gt;info.AddValue(&quot;date&quot;, date);&lt;br /&gt;info.AddValue(&quot;total&quot;, total);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#endregion&lt;br /&gt;&lt;br /&gt;11. When does a change in my object break the deserialization?&lt;br /&gt;&lt;br /&gt;Binary serialization is not tolerant to version change. There is no problem when a new field is added but if a field is missing, an exception is throw. New field will get the default value. .Net 2.0 include a new attribute named OptionalFieldAttribute. For previous version, you must implement your own custom serialization and handle manually the changes.&lt;br /&gt;12. When does a change in my object NOT break the deserialization?&lt;br /&gt;&lt;br /&gt;Version fault exception are only checked if the assembly is signed, all version change are ignored otherwise.&lt;br /&gt;13. How can I make my object version tolerant?&lt;br /&gt;&lt;br /&gt;Use the OptionalFieldAttribute or implement your own custom serialization with ISerializable.&lt;br /&gt;14. Why set VersionAdded of OptionalFieldAttribute since it&#39;s a free text?&lt;br /&gt;&lt;br /&gt;The parameter is only for informative purpose. .Net never checked it by default but it could be used in a custom serialization. Use the reflection to get the attribute of field and check the added version value.&lt;br /&gt;&lt;br /&gt;15. Does BinaryFormatter from .Net 1.1 is compatible with the BinaryFormatter 2.0?&lt;br /&gt;Absolutely, the BinaryFormatter 2.0 is 100% with other version, but it&#39;s not the case with the SoapFormatter.&lt;br /&gt;16. How can I modify a value just before the serialization or just after the deserialization?&lt;br /&gt;You can add custom attribute to some method. Your marked method will get called a the right time. This is usefull to initialize a property after the deserialization or to clean up your instance before the serialization.&lt;br /&gt;• OnDeserializingAttribute :This event happens before deserialization&lt;br /&gt;• OnDeserializedAttribute :This event happens after deserialization&lt;br /&gt;• OnSerializingAttribute :This event happens before serialization&lt;br /&gt;• OnSerializedAttribute :This even happens after serialization&lt;br /&gt;[Serializable]&lt;br /&gt;public class SecurityToken {&lt;br /&gt;private string password;&lt;br /&gt;private string userName;&lt;br /&gt;&lt;br /&gt;private string Decrypt(string aPassword) {&lt;br /&gt;// Decrypt the password here !!!&lt;br /&gt;return password;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private string Encrypt(string aPassword) {&lt;br /&gt;// Encrypt the password here !!!&lt;br /&gt;return password;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;[OnSerializing()]&lt;br /&gt;internal void OnSerializingMethod(StreamingContext context) {&lt;br /&gt;password = Encrypt(password);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;[OnDeserialized()]&lt;br /&gt;internal void OnDeserializedMethod(StreamingContext context) {&lt;br /&gt;password = Decrypt(password);&lt;br /&gt;&lt;br /&gt;// Set the default&lt;br /&gt;if (userName == null) {&lt;br /&gt;userName = Environment.UserName;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public string Password {&lt;br /&gt;get {&lt;br /&gt;return password;&lt;br /&gt;}&lt;br /&gt;set {&lt;br /&gt;password = value;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public string UserName {&lt;br /&gt;get {&lt;br /&gt;return userName;&lt;br /&gt;}&lt;br /&gt;set {&lt;br /&gt;userName = value;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;17. How can I create a generic Binary deserialization method?&lt;br /&gt;// Binary deserialization (generic version with the return value casted)&lt;br /&gt;public static T DeserializeBinary&lt;t&gt;(string aFileName) {&lt;br /&gt;using (FileStream _FileStream = new FileStream(aFileName, FileMode.Open)) {&lt;br /&gt;BinaryFormatter _Formatter = new BinaryFormatter();&lt;br /&gt;return (T)_Formatter.Deserialize(_FileStream);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;Xml Serialization&lt;br /&gt;1. Which class is responsible for Xml serialization?&lt;br /&gt;&lt;br /&gt;XmlSerializer is responsible of the Xml serialization.&lt;br /&gt;2. What is the difference between the SoapFormatter and the XmlSerializer?&lt;br /&gt;&lt;br /&gt;SoapFormatter is used to create a Soap envelop and use an object graph to generate the result. The XmlSerializer process use only the public data and the result is a more common xml file. The Web Service in .Net use an XmlSerializer to generate the output contained in the Soap message. The SoapFormatter and the BinaryFormatter are used in the .Net Remoting serialization process.&lt;br /&gt;3. What does it take to make my object serializable?&lt;br /&gt;&lt;br /&gt;Nothing, but there is some constraint :&lt;br /&gt;• Your object must have a public empty constructor.&lt;br /&gt;• Field or property must be public&lt;br /&gt;• Their return type must also respect serialization rules.&lt;br /&gt;• Property must be read write.&lt;br /&gt;4. What are the main advantages of Xml serialization?&lt;br /&gt;• Based on international standard (XML).&lt;br /&gt;• Cross platforms.&lt;br /&gt;• Readable and can be edited easily.&lt;br /&gt;5. How do I encapsulate the Xml serialization method?&lt;br /&gt;public static void SerializeXml( object aObject, string aFileName) {&lt;br /&gt;using (FileStream _FileStream = new FileStream(aFileName, FileMode.Create)) {&lt;br /&gt;XmlSerializer _Serializer = new XmlSerializer ( aObject.GetType());&lt;br /&gt;_Serializer.Serialize(_FileStream, aObject);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;6. How do I encapsulate the Xml deserialization method?&lt;br /&gt;public static object DeserializeXml( string aFileName, Type aType) {&lt;br /&gt;using (FileStream _FileStream = new FileStream(aFileName, FileMode.Create)) {&lt;br /&gt;XmlSerializer _Serializer = new XmlSerializer (aType);&lt;br /&gt;return _Serializer.Deserialize(_FileStream);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;7. How can I create a generic Xml deserialization method?&lt;br /&gt;public static T DeserializeXml&lt;t&gt;(string aFileName) {&lt;br /&gt;using (FileStream _FileStream = new FileStream(aFileName, FileMode.Open)) {&lt;br /&gt;XmlSerializer _Serializer = new XmlSerializer (typeof(T));&lt;br /&gt;return (T)_Serializer.Deserialize(_FileStream);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;8. How can I ignore a property in serialization?&lt;br /&gt;&lt;br /&gt;If you use a XmlSerializer, mark your property with the custom attribute XmlIgnoreAttribute and if you use a SoapFormatter, use a SoapIgnoreAttribute instead.&lt;br /&gt;&lt;br /&gt;9. How can I rename a field or a property in the Xml output?&lt;br /&gt;&lt;br /&gt;Use the attribute XmlElementAttribute or XmlAttributeAttribute with the new name as parameter. To rename a class, use the XmlTypeAttribute.&lt;br /&gt;[XmlType(&quot;city&quot;)]&lt;br /&gt;public class Town {&lt;br /&gt;private string name;&lt;br /&gt;private string state;&lt;br /&gt;&lt;br /&gt;[XmlElement(&quot;townname&quot;)]&lt;br /&gt;public string Name {&lt;br /&gt;get {&lt;br /&gt;return name;&lt;br /&gt;}&lt;br /&gt;set {&lt;br /&gt;name = value;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;[XmlAttribute(&quot;state&quot;)]&lt;br /&gt;public string State {&lt;br /&gt;get {&lt;br /&gt;return state;&lt;br /&gt;}&lt;br /&gt;set {&lt;br /&gt;state = value;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;Result:&lt;br /&gt;&lt;?xml version=&quot;1.0&quot;?&gt;&lt;br /&gt;&lt;city state=&quot;CA&quot;&gt;&lt;br /&gt;&lt;townname&gt;Los Angeles&lt;/townname&gt;&lt;br /&gt;&lt;/city&gt;&lt;br /&gt;10. How can I read a field from an Xml stream without deserializing it?&lt;br /&gt;&lt;br /&gt;XPath can do the job.. This is an example where we read the town name (Xml element) )and the state attribute from the Xml file:&lt;br /&gt;XmlDocument document = new XmlDocument();&lt;br /&gt;document.Load(&quot;town.xml&quot;);&lt;br /&gt;&lt;br /&gt;//Select an element&lt;br /&gt;string _TownName = document.SelectSingleNode(&quot;//city/townname&quot;).InnerText;&lt;br /&gt;&lt;br /&gt;//Select an attribute&lt;br /&gt;string _State =&lt;br /&gt;document.SelectSingleNode(&quot;//city&quot;).Attributes[&quot;state&quot;].InnerText;&lt;br /&gt;&lt;br /&gt;MessageBox.Show(_TownName + &quot; is in &quot; + _State);&lt;br /&gt;This is an example where we read an application setting from a web config file.&lt;br /&gt;XmlDocument configDocument = new XmlDocument();&lt;br /&gt;configDocument.Load(&quot;web.config&quot;);&lt;br /&gt;&lt;br /&gt;// Add the namespace with .Net web.config&lt;br /&gt;XmlNamespaceManager nsmgr = new XmlNamespaceManager(configDocument.NameTable);&lt;br /&gt;nsmgr.AddNamespace(&quot;ms&quot;, &quot;http://schemas.microsoft.com/.NetConfiguration/v2.0&quot;);&lt;br /&gt;&lt;br /&gt;string appSetting = configDocument.SelectSingleNode(&lt;br /&gt;&quot;/ms:configuration/ms:appSettings/ms:add[@key=&#39;DatabaseName&#39;]&quot;,&lt;br /&gt;nsmgr).Attributes[&quot;value&quot;].InnerText;&lt;br /&gt;The orignal config file:&lt;br /&gt;&lt;?XML:NAMESPACE PREFIX = [default] http://schemas.microsoft.com/.NetConfiguration/v2.0 NS = &quot;http://schemas.microsoft.com/.NetConfiguration/v2.0&quot; /&gt;&lt;configuration xmlns=&quot;http://schemas.microsoft.com/.NetConfiguration/v2.0&quot;&gt;&lt;br /&gt;&lt;appsettings&gt;&lt;br /&gt;&lt;add value=&quot;Pubs&quot; key=&quot;DatabaseName&quot;&gt;&lt;/add&gt;&lt;br /&gt;&lt;add value=&quot;(local)&quot; key=&quot;DatabaseServer&quot;&gt;&lt;/add&gt;&lt;br /&gt;&lt;/appsettings&gt;&lt;br /&gt;&lt;/configuration&gt;&lt;br /&gt;Note, you don&#39;t need the XmlNamespaceManager if you don&#39;t have a default namespace. Web.config in the ealier version does not contain a default namespace.&lt;br /&gt;11. How can I serialize a property as an Xml attribute?&lt;br /&gt;&lt;br /&gt;By default properties are serialized as Xml elements, but if you add an XmlAttributeAttribute to a property, .Net will generate an attribute instead. It&#39;s must be type compatible with an Xml attribute. See example here&lt;br /&gt;...&lt;br /&gt;[XmlAttribute(&quot;state&quot;)]&lt;br /&gt;public string State {&lt;br /&gt;get {&lt;br /&gt;return state;&lt;br /&gt;}&lt;br /&gt;set {&lt;br /&gt;state = value;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;12. How can I implement custom serialization?&lt;br /&gt;&lt;br /&gt;You need to Implement the interface IXmlSerializable. This class is available in the .Net 1.X but it&#39;s was not documented. It&#39;s now official available with .Net 2.0. With custom serialization, it&#39;s possible to optimize the output and generate only what is needed. In this example, we generate only the non empty properties&lt;br /&gt;public class SessionInfo : IXmlSerializable {&lt;br /&gt;&lt;br /&gt;#region IXmlSerializable Members&lt;br /&gt;&lt;br /&gt;public System.Xml.Schema.XmlSchema GetSchema() {&lt;br /&gt;return null;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void ReadXml(XmlReader reader) {&lt;br /&gt;UserName = reader.GetAttribute(&quot;UserName&quot;);&lt;br /&gt;&lt;br /&gt;while (reader.Read()) {&lt;br /&gt;if (reader.IsStartElement()) {&lt;br /&gt;if (!reader.IsEmptyElement) {&lt;br /&gt;string _ElementName = reader.Name;&lt;br /&gt;reader.Read(); // Read the start tag.&lt;br /&gt;&lt;br /&gt;if(_ElementName == &quot;MachineName&quot;) {&lt;br /&gt;MachineName = reader.ReadString();&lt;br /&gt;} else {&lt;br /&gt;reader.Read();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void WriteXml(XmlWriter writer) {&lt;br /&gt;if (!String.IsNullOrEmpty(UserName))&lt;br /&gt;writer.WriteAttributeString(&quot;UserName&quot;, UserName);&lt;br /&gt;&lt;br /&gt;if (!String.IsNullOrEmpty(MachineName))&lt;br /&gt;writer.WriteElementString(&quot;MachineName&quot;, MachineName);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#endregion&lt;br /&gt;&lt;br /&gt;private string machineName;&lt;br /&gt;private string userName;&lt;br /&gt;&lt;br /&gt;public string MachineName {&lt;br /&gt;get {&lt;br /&gt;return machineName;&lt;br /&gt;}&lt;br /&gt;set {&lt;br /&gt;machineName = value;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public string UserName {&lt;br /&gt;get {&lt;br /&gt;return userName;&lt;br /&gt;}&lt;br /&gt;set {&lt;br /&gt;userName = value;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;The output could be something like that if UserName and Machine are not empty :&lt;br /&gt;&lt;?xml version=&quot;1.0&quot;?&gt;&lt;br /&gt;&lt;sessioninfo username=&quot;David&quot;&gt;&lt;br /&gt;&lt;machinename&gt;MyMachine&lt;/machinename&gt;&lt;br /&gt;&lt;/sessioninfo&gt;&lt;br /&gt;or it could be like that if MachineName is empty :&lt;br /&gt;&lt;?xml version=&quot;1.0&quot;?&gt;&lt;br /&gt;&lt;/ UserName=&quot;David&quot; v2.0:SessionInfo .NetConfiguration schemas.microsoft.com&gt;&lt;br /&gt;13. How can I serialize a property array?&lt;br /&gt;&lt;br /&gt;Array are compatible with the serialization, but all elements must be of the same type. If not all types must be specified, see below.&lt;br /&gt;&lt;br /&gt;14. How can I serialize an array with different types?&lt;br /&gt;&lt;br /&gt;It&#39;s possible to tag the array with all the possible type. Use XmlInclude on the class containing the array or XmlArrayItem. All the possible types must be specified with the attributes. Array types must be known because of the Xml schema. XmlInclude could be used for property that returned differente types. It&#39;s complicate object inheritance since all types must be known.&lt;br /&gt;This example will fail with a message &quot;There was an error generating the XML document.&quot; because the Cars could contain undefined types.&lt;br /&gt;public class Car {}&lt;br /&gt;&lt;br /&gt;public class Ford : Car{}&lt;br /&gt;&lt;br /&gt;public class Honda: Car {}&lt;br /&gt;&lt;br /&gt;public class Toyota: Car {}&lt;br /&gt;&lt;br /&gt;public class CarSeller {&lt;br /&gt;private List&lt;/ .NetConfiguration schemas.microsoft.com v2.0:Car&gt; cars = new List&lt;/ .NetConfiguration schemas.microsoft.com v2.0:Car&gt;();&lt;br /&gt;&lt;br /&gt;public List&lt;/ .NetConfiguration schemas.microsoft.com v2.0:Car&gt; Cars {&lt;br /&gt;get {&lt;br /&gt;return cars;&lt;br /&gt;}&lt;br /&gt;set {&lt;br /&gt;cars = value;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;...&lt;br /&gt;Ford _Ford = new Ford();&lt;br /&gt;Honda _Honda = new Honda();&lt;br /&gt;Toyota _Toyota = new Toyota();&lt;br /&gt;&lt;br /&gt;CarSeller _Seller = new CarSeller();&lt;br /&gt;_Seller.Cars.Add(_Ford);&lt;br /&gt;_Seller.Cars.Add(_Honda);&lt;br /&gt;_Seller.Cars.Add(_Toyota);&lt;br /&gt;&lt;br /&gt;SerializationHelper.SerializeXml(_Seller, @&quot;seller.xml&quot;);&lt;br /&gt;Three possible solutions:&lt;br /&gt;#1 Add XmlIncludeAttribute to the Seller class:&lt;br /&gt;[XmlInclude(typeof(Ford))]&lt;br /&gt;[XmlInclude(typeof(Honda))]&lt;br /&gt;[XmlInclude(typeof(Toyota))]&lt;br /&gt;public class CarSeller {&lt;br /&gt;private List&lt;/ .NetConfiguration schemas.microsoft.com v2.0:Car&gt; cars = new List&lt;/ .NetConfiguration schemas.microsoft.com v2.0:Car&gt;();&lt;br /&gt;&lt;br /&gt;public List&lt;/ .NetConfiguration schemas.microsoft.com v2.0:Car&gt; Cars {&lt;br /&gt;get {&lt;br /&gt;return cars;&lt;br /&gt;}&lt;br /&gt;set {&lt;br /&gt;cars = value;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;with this result&lt;br /&gt;&lt;?xml version=&quot;1.0&quot;?&gt;&lt;br /&gt;&lt;carseller&gt;&lt;br /&gt;&lt;cars&gt;&lt;br /&gt;&lt;car type=&quot;Ford&quot;&gt;&lt;/car&gt;&lt;br /&gt;&lt;car type=&quot;Honda&quot;&gt;&lt;/car&gt;&lt;br /&gt;&lt;car type=&quot;Toyota&quot;&gt;&lt;/car&gt;&lt;br /&gt;&lt;/cars&gt;&lt;br /&gt;&lt;/carseller&gt;&lt;br /&gt;#2 Add XmlArrayItem to the property named Cars:&lt;br /&gt;public class CarSeller {&lt;br /&gt;private List&lt;/ .NetConfiguration schemas.microsoft.com v2.0:Car&gt; cars = new List&lt;/ .NetConfiguration schemas.microsoft.com v2.0:Car&gt;();&lt;br /&gt;&lt;br /&gt;[XmlArrayItem(typeof(Ford))]&lt;br /&gt;[XmlArrayItem(typeof(Honda))]&lt;br /&gt;[XmlArrayItem(typeof(Toyota))]&lt;br /&gt;public List&lt;/ .NetConfiguration schemas.microsoft.com v2.0:Car&gt; Cars {&lt;br /&gt;get {&lt;br /&gt;return cars;&lt;br /&gt;}&lt;br /&gt;set {&lt;br /&gt;cars = value;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;with this result&lt;br /&gt;&lt;?xml version=&quot;1.0&quot;?&gt;&lt;br /&gt;&lt;carseller&gt;&lt;br /&gt;&lt;cars&gt;&lt;br /&gt;&lt;ford&gt;&lt;/ford&gt;&lt;br /&gt;&lt;honda&gt;&lt;/honda&gt;&lt;br /&gt;&lt;toyota&gt;&lt;/toyota&gt;&lt;br /&gt;&lt;/cars&gt;&lt;br /&gt;&lt;/carseller&gt;&lt;br /&gt;#3 Implement our own serialization with IXmlSerializable :&lt;br /&gt;see items above&lt;br /&gt;&lt;br /&gt;15. How can I serialize a collection?&lt;br /&gt;&lt;br /&gt;Collection are serialized correctly, but they must contains only object of same types. Read only properties of type ArrayList, List&lt;/ .NetConfiguration schemas.microsoft.com v2.0:type&gt; and other collections will be serialized and deserialized correctly.&lt;br /&gt;public class Role {&lt;br /&gt;private string name;&lt;br /&gt;&lt;br /&gt;public string Name&lt;br /&gt;{&lt;br /&gt;get { return name; }&lt;br /&gt;set { name = value; }&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public class UserAccount {&lt;br /&gt;private string userName;&lt;br /&gt;&lt;br /&gt;public string UserName {&lt;br /&gt;get {&lt;br /&gt;return userName;&lt;br /&gt;}&lt;br /&gt;set {&lt;br /&gt;userName = value;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// Generic version&lt;br /&gt;private List&lt;/ .NetConfiguration schemas.microsoft.com v2.0:Role&gt; roles = new List&lt;/ .NetConfiguration schemas.microsoft.com v2.0:Role&gt;();&lt;br /&gt;&lt;br /&gt;public List&lt;/ .NetConfiguration schemas.microsoft.com v2.0:Role&gt; Roles {&lt;br /&gt;get {&lt;br /&gt;return roles;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// ArrayList version&lt;br /&gt;private ArrayList roleList = new ArrayList();&lt;br /&gt;&lt;br /&gt;public ArrayList RoleList {&lt;br /&gt;get {&lt;br /&gt;return roleList;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// String collection version&lt;br /&gt;private StringCollection roleNames = new StringCollection();&lt;br /&gt;&lt;br /&gt;public StringCollection RoleNames {&lt;br /&gt;get {&lt;br /&gt;return roleNames;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;UserAccount _UserAccount = new UserAccount();&lt;br /&gt;_UserAccount.UserName = &quot;dhervieux&quot;;&lt;br /&gt;&lt;br /&gt;Role _RoleAdmin = new Role();&lt;br /&gt;_RoleAdmin.Name = &quot;Admin&quot;;&lt;br /&gt;&lt;br /&gt;Role _RoleSales = new Role();&lt;br /&gt;_RoleSales.Name = &quot;Sales&quot;;&lt;br /&gt;&lt;br /&gt;_UserAccount.RoleList.Add(_RoleAdmin);&lt;br /&gt;_UserAccount.RoleList.Add(_RoleSales);&lt;br /&gt;_UserAccount.Roles.Add(_RoleAdmin);&lt;br /&gt;_UserAccount.Roles.Add(_RoleSales);&lt;br /&gt;_UserAccount.RoleNames.Add(&quot;Admin&quot;);&lt;br /&gt;_UserAccount.RoleNames.Add(&quot;Sales&quot;);&lt;br /&gt;&lt;br /&gt;SerializationHelper.SerializeXml(_UserAccount, @&quot;useraccount.xml&quot;);&lt;br /&gt;UserAccount _Result =&lt;br /&gt;SerializationHelper.DeserializeXml&lt;/ .NetConfiguration schemas.microsoft.com v2.0:UserAccount&gt;(@&quot;useraccount.xml&quot;);&lt;br /&gt;will produce:&lt;br /&gt;&lt;?xml version=&quot;1.0&quot;?&gt;&lt;br /&gt;&lt;useraccount&gt;&lt;br /&gt;&lt;username&gt;dhervieux&lt;/username&gt;&lt;br /&gt;&lt;roles&gt;&lt;br /&gt;&lt;role&gt;&lt;br /&gt;&lt;name&gt;Admin&lt;/name&gt;&lt;br /&gt;&lt;/role&gt;&lt;br /&gt;&lt;role&gt;&lt;br /&gt;&lt;name&gt;Sales&lt;/name&gt;&lt;br /&gt;&lt;/role&gt;&lt;br /&gt;&lt;/roles&gt;&lt;br /&gt;&lt;rolelist&gt;&lt;br /&gt;&lt;anytype type=&quot;Role&quot;&gt;&lt;br /&gt;&lt;name&gt;Admin&lt;/name&gt;&lt;br /&gt;&lt;/anytype&gt;&lt;br /&gt;&lt;anytype type=&quot;Role&quot;&gt;&lt;br /&gt;&lt;name&gt;Sales&lt;/name&gt;&lt;br /&gt;&lt;/anytype&gt;&lt;br /&gt;&lt;/rolelist&gt;&lt;br /&gt;&lt;rolenames&gt;&lt;br /&gt;&lt;string&gt;Admin&lt;/string&gt;&lt;br /&gt;&lt;string&gt;Sales&lt;/string&gt;&lt;br /&gt;&lt;/rolenames&gt;&lt;br /&gt;&lt;/useraccount&gt;&lt;br /&gt;16. Why is the first serialization of each type of object is so long?&lt;br /&gt;&lt;br /&gt;XmlSerializer generate an assembly in memory optimized for each type. That&#39;s explain why the first call to a Web Service is so long. In .Net 2.0, there is an option in the project properties of Visual Studio to generate the Xml serialization assembly. Use it directly in the IDE or use sgen.exe, this tools come with the .Net Framework SDK.&lt;br /&gt;17. How can I optimize the serialization process?&lt;br /&gt;&lt;br /&gt;Pregenerate your serialization assembly with Visual Studio or sgen.exe. See details in answer above. Implementing your own serialization could also increase the performance.&lt;br /&gt;18. How can I serialize an array directly to stream?&lt;br /&gt;&lt;br /&gt;Yes it possible. .Net will name the Array and save the content. All the data must be of the same type.&lt;br /&gt;bool[] _BoolArray = new bool[] { true, false, false, true };&lt;br /&gt;&lt;br /&gt;// Serialization&lt;br /&gt;SerializationHelper.SerializeXml(_BoolArray, @&quot;boolarray.xml&quot;);&lt;br /&gt;&lt;br /&gt;//Deserialization&lt;br /&gt;_Result = SerializationHelper.DeserializeXml&lt;/ .NetConfiguration schemas.microsoft.com v2.0:bool[]&gt;(@&quot;directboolarray.xml&quot;);&lt;br /&gt;will produce:&lt;br /&gt;&lt;?xml version=&quot;1.0&quot;?&gt;&lt;br /&gt;&lt;arrayofboolean&gt;&lt;br /&gt;&lt;boolean&gt;true&lt;/boolean&gt;&lt;br /&gt;&lt;boolean&gt;false&lt;/boolean&gt;&lt;br /&gt;&lt;boolean&gt;false&lt;/boolean&gt;&lt;br /&gt;&lt;boolean&gt;true&lt;/boolean&gt;&lt;br /&gt;&lt;/arrayofboolean&gt;&lt;br /&gt;19. Which serializer is used by a Web Services?&lt;br /&gt;&lt;br /&gt;Web Services are using SOAP to communicate, but returned objets or parameters are serialized with the XmlSerializer. Write unit test to be sure that your objects are serializable.&lt;br /&gt;20. Does read only properties are serialized?&lt;br /&gt;&lt;br /&gt;No, they are not, except for collections.&lt;br /&gt;21. How can I serialize a multidimensional array&lt;br /&gt;&lt;br /&gt;You need to encapsulate your array in a structure or a class an serialize it. Multidimensional array are not serializable by default.&lt;br /&gt;22. How can I avoid serialization for an empty list or property with a default value?&lt;br /&gt;&lt;br /&gt;There is an undocumented way of doing that, you need to create a method named ShouldSerialize&lt;/ .NetConfiguration schemas.microsoft.com v2.0:propertyname&gt; where &lt;/ .NetConfiguration schemas.microsoft.com v2.0:propertyname&gt;is replaced by the property name. This method should return a boolean that indicate if the property must be serialized or not. For exemple, if you have list with no item, there is no need to serialize an empty list.&lt;br /&gt;public class Registration {&lt;br /&gt;private string[] users = new string[0];&lt;br /&gt;&lt;br /&gt;public bool ShouldSerializeUsers() {&lt;br /&gt;return users.Length &gt; 0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public string[] Users {&lt;br /&gt;get {&lt;br /&gt;return users;&lt;br /&gt;}&lt;br /&gt;set {&lt;br /&gt;users = value;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;Result :&lt;br /&gt;&lt;?xml version=&quot;1.0&quot;?&gt;&lt;br /&gt;&lt;registration&gt;&lt;/registration&gt;&lt;br /&gt;Without the ShouldSerializeUsers :&lt;br /&gt;&lt;?xml version=&quot;1.0&quot;?&gt;&lt;br /&gt;&lt;registration&gt;&lt;br /&gt;&lt;users&gt;&lt;/users&gt;&lt;br /&gt;&lt;/registration&gt;&lt;br /&gt;&lt;br /&gt;23. Why my object is marked as Serializable (like SortedList) and it&#39;s does not work?&lt;br /&gt;&lt;br /&gt;The SerializationAttribute is only used for the binary serialization. That does not mean that it will work with an XmlSerializer. That&#39;s the case of the SortedList.&lt;br /&gt;24. How to remove the default namespace in the serialization?&lt;br /&gt;&lt;br /&gt;It&#39;s possible to remove the xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; and xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; from the serialization result, it&#39;s possible to add an XmlSerializerNamespaces with an empty namespace mapping.&lt;br /&gt;User _User = new User(new string[] { &quot;Admin&quot;, &quot;Manager&quot; });&lt;br /&gt;&lt;br /&gt;using (FileStream _FileStream = new FileStream(&quot;user.xml&quot;, FileMode.Create)) {&lt;br /&gt;XmlSerializer _Serializer = new XmlSerializer(_User.GetType());&lt;br /&gt;&lt;br /&gt;XmlSerializerNamespaces ns = new XmlSerializerNamespaces();&lt;br /&gt;ns.Add(&quot;&quot;, &quot;&quot;);&lt;br /&gt;&lt;br /&gt;_Serializer.Serialize(_FileStream, _User, ns);&lt;br /&gt;}&lt;br /&gt;&lt;/div&gt;&lt;/ .NetConfiguration schemas.microsoft.com v2.0:propertyname&gt;&lt;/ .NetConfiguration schemas.microsoft.com v2.0:propertyname&gt;&lt;/ .NetConfiguration schemas.microsoft.com v2.0:bool[]&gt;&lt;/ .NetConfiguration schemas.microsoft.com v2.0:UserAccount&gt;&lt;/ .NetConfiguration schemas.microsoft.com v2.0:Role&gt;&lt;/ .NetConfiguration schemas.microsoft.com v2.0:Role&gt;&lt;/ .NetConfiguration schemas.microsoft.com v2.0:Role&gt;&lt;/ .NetConfiguration schemas.microsoft.com v2.0:type&gt;&lt;/ .NetConfiguration schemas.microsoft.com v2.0:Car&gt;&lt;/ .NetConfiguration schemas.microsoft.com v2.0:Car&gt;&lt;/ .NetConfiguration schemas.microsoft.com v2.0:Car&gt;&lt;/ .NetConfiguration schemas.microsoft.com v2.0:Car&gt;&lt;/ .NetConfiguration schemas.microsoft.com v2.0:Car&gt;&lt;/ .NetConfiguration schemas.microsoft.com v2.0:Car&gt;&lt;/ .NetConfiguration schemas.microsoft.com v2.0:Car&gt;&lt;/ .NetConfiguration schemas.microsoft.com v2.0:Car&gt;&lt;/ .NetConfiguration schemas.microsoft.com v2.0:Car&gt;&lt;/ v2.0:SessionInfo .NetConfiguration schemas.microsoft.com&gt;</content><link rel='replies' type='application/atom+xml' href='http://gudurin.blogspot.com/feeds/96344752446917635/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1819512445879631740/96344752446917635' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1819512445879631740/posts/default/96344752446917635'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1819512445879631740/posts/default/96344752446917635'/><link rel='alternate' type='text/html' href='http://gudurin.blogspot.com/2009/07/c-serialzation.html' title='C# serialzation'/><author><name>Naresh Guduri Blog</name><uri>http://www.blogger.com/profile/02461913656830998473</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1819512445879631740.post-4617106447355557076</id><published>2009-06-27T14:48:00.000-07:00</published><updated>2009-06-27T14:53:35.780-07:00</updated><title type='text'></title><content type='html'>WPF patterns : MVC, MVP or MVVM or…?&lt;br /&gt;&lt;br /&gt;Introduction&lt;br /&gt;Since XAML things have become a bit complicated in trying to conceptualize MVC architectures for Windows applications. The gap between web and win is narrowing and the whole WPF thing adds diverse possibilities to one’s toobox. What to use? Model-view-controler, the model-view-presenter or the new paradigm called model-view-viewmodel?&lt;br /&gt;I have tried to understand what it’s all about and this is what I found out.&lt;br /&gt;What’s the problem?&lt;br /&gt;WPF has changed a few things:&lt;br /&gt;through declarative programming (i.e. XAML) a lot of plumbing is created for you which especially in the context of databinding saves a lot of code. Another area is e.g. animations and styling; what previously had to be programmed in C# is now possible inside XAML through triggers or events.&lt;br /&gt;in the MVC pattern the View is presenting the data from the Model but now XAML does this job and sometimes need things like value converters or the ObservableCollection to update the presentation&lt;br /&gt;user controls in WPF allow you to define a default generic.xaml style which can be overriden when used inside an application, i.e. styling of existing controls is a new feature which adds flexibility to the presentation of the Model&lt;br /&gt;XAML allows a wide variety of mechanisms to change things or to react to user actions; through the ICommand that is now defined in the framework, through triggers in XAML, through animations, through event bubbling or tunneling (which is also new)&lt;br /&gt;The MVVM architecture&lt;br /&gt;Overview&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.orbifold.net/default/wp-content/uploads/MVVM.jpg&quot;&gt;&lt;img style=&quot;MARGIN: 0px 10px 10px 0px; WIDTH: 432px; FLOAT: left; HEIGHT: 276px; CURSOR: hand&quot; border=&quot;0&quot; alt=&quot;&quot; src=&quot;http://www.orbifold.net/default/wp-content/uploads/MVVM.jpg&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt; &lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;DataModel&lt;br /&gt;DataModel is responsible for exposing data in a way that is easily consumable by WPF. All of its public APIs must be called on the UI thread only. It must implement INotifyPropertyChanged and/or INotifyCollectionChanged as appropriate. When data is expensive to fetch, it abstracts away the expensive operations, never blocking the UI thread (that is evil!). It also keeps the data “live” and can be used to combine data from multiple sources. These sorts of classes are fairly straightforward to unit test. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;ViewModel&lt;br /&gt;A ViewModel is a model for a view in the application (duh!). It exposes data relevant to the view and exposes the behaviors for the views, usually with Commands. The model is fairly specific to a view in the application, but does not subclass from any WPF classes or make assumptions about the UI that will be bound to it. Since they are separate from the actual UI, these classes are also relatively straightforward to unit test.&lt;br /&gt;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;View&lt;br /&gt;A View is the actual UI behind a view in the application. The pattern we use is to set the DataContext of a view to its ViewModel. This makes it easy to get to the ViewModel through binding. It also matches the DataTemplate/Data pattern of WPF. Ideally, the view can be implemented purely as Xaml with no code behind. The attached property trick comes in very handy for this. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;The lines between DataModels and ViewModels can be blurry. DataModels are often shown in the UI with some DataTemplate, which isn’t really so different than the way we use ViewModels. However, the distinction usually makes sense in practice. I also want to point out that there’s often composition at many layers. ViewModels may compose other ViewModels and DataModels. And, DataModels may be composed of other DataModels.&lt;br /&gt;The ViewModel is a model of the view. That means: You want to DataBind a property fromyour DataObject (model) to a property from your ViewObject (view) but you sometimes cannot bind directly to a CLR property of the model (because of converting or calculating). This is when ViewModel comes into play. It propagates the already calculated or converted value from your model, so you can bind this property directly to the view property.&lt;br /&gt;The main thrust of the Model/View/ViewModel architecture seems to be that on top of the data (”the Model”), there’s another layer of non-visual components (”the ViewModel”) that map the concepts of the data more closely to the concepts of the view of the data (”the View”). It’s the ViewModel that the View binds to, not the Model directly. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;The model&lt;br /&gt;Using the INotifyPropertyChanged you can bubble changes up the stack. The reason that public methods should be on the UI thread is because the model could call long running or async stuff which would block the UI, though there are methods to let the UI thread handle property changes from a separate thread. See the doc on the &lt;a style=&quot;COLOR: rgb(255,153,0); TEXT-DECORATION: none&quot; onclick=&quot;urchinTracker(&#39;/outgoing/msdn2.microsoft.com/en-us/library/ms741870.aspx?referer=&#39;);&quot; href=&quot;http://msdn2.microsoft.com/en-us/library/ms741870.aspx&quot;&gt;Dispatcher &lt;/a&gt;object and the WPF threading model for more on this. Note in this context that you can let things happen in the background by means of the BeginInvoke()method of the Dispatcher and the paramter that specifies the priority. The SystemIdle in particular is interesting to be used when the Dispatcher is not busy.&lt;br /&gt;The DataModel you can find in the download is mimiced from the Dan Crevier’s sample and can serve as an abstract base class for your own models. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;Dispatcher things&lt;br /&gt;The DispatcherTimer is reevaluated at the top of every Dispatcher loop.&lt;br /&gt;Timers are not guaranteed to execute exactly when the time interval occurs, but are guaranteed to not execute before the time interval occurs. This is because DispatcherTimer operations are placed on the Dispatcher queue like other operations. When the DispatcherTimer operation executes is dependent on the other jobs in the queue and their priorities.&lt;br /&gt;If a System.Timers.Timer is used in a WPF application, it is worth noting that the System.Timers.Timer runs on a different thread then the user interface (UI) thread. In order to access objects on the user interface (UI) thread, it is necessary to post the operation onto the Dispatcher of the user interface (UI) thread using Invoke or BeginInvoke. For an example of using a System.Timers.Timer, see the Disable Command Source Via System Timer sample. Reasons for using a DispatcherTimer opposed to a System.Timers.Timer are that the DispatcherTimer runs on the same thread as the Dispatcher and a DispatcherPriority can be set on the DispatcherTimer. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;A DispatcherTimer will keep an object alive whenever the object’s methods are bound to the timer. So, the right way to schedule things inside the WPF UI is something like;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;[csharp]&lt;/div&gt;&lt;div&gt;private DispatcherTimer _timer;timer = new DispatcherTimer(DispatcherPriority.Background);timer.Interval = TimeSpan.FromMinutes(5);&lt;/div&gt;&lt;div&gt;timer.Tick += delegate { ScheduleUpdate(); };timer.Start();&lt;br /&gt;[/csharp]&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;the timer is injected implicitly in the thread associated to the dispatcher of the UI. &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gudurin.blogspot.com/feeds/4617106447355557076/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1819512445879631740/4617106447355557076' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1819512445879631740/posts/default/4617106447355557076'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1819512445879631740/posts/default/4617106447355557076'/><link rel='alternate' type='text/html' href='http://gudurin.blogspot.com/2009/06/wpf-patterns-mvc-mvp-or-mvvm-or.html' title=''/><author><name>Naresh Guduri Blog</name><uri>http://www.blogger.com/profile/02461913656830998473</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1819512445879631740.post-5184664076090608415</id><published>2009-06-18T08:34:00.000-07:00</published><updated>2009-06-18T08:36:01.632-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C#3.0"/><category scheme="http://www.blogger.com/atom/ns#" term="Concordance"/><title type='text'>Concordance implementation in C#3.0</title><content type='html'>using System;&lt;br /&gt;using System.IO;&lt;br /&gt;using System.Collections;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Text.RegularExpressions;&lt;br /&gt;namespace Concordance&lt;br /&gt;{&lt;br /&gt;class Program&lt;br /&gt;{&lt;br /&gt;/// &lt;method method=&quot;&quot;&gt;Method Name: Main&lt;/method&gt;&lt;br /&gt;/// &lt;description description=&quot;&quot;&gt;Description: &lt;para&gt;&lt;br /&gt;/// This method is the main method to perform the Concordance .&lt;br /&gt;/// Limitations of the Program:As of now this program is tested to identify&lt;br /&gt;/// that it cannot recognize ACRONYMS like i.e. etc&lt;br /&gt;/// &lt;end/&gt;&lt;br /&gt;static void Main(string[] args)&lt;br /&gt;{&lt;br /&gt;string strString =&lt;br /&gt;&quot;Given an arbitrary text document written in English, write a program that will generate a concordance, i.e. an alphabetical list of all word occurrences, labeled with word frequencies. Bonus: label each word with the sentence numbers in which each occurrence appeared.&quot;;&lt;br /&gt;// Get the list of all words from the input text.&lt;br /&gt;string[] inputTextArray =&lt;br /&gt;strString.ToLower().Split(&lt;br /&gt;new char[] {&#39;.&#39;, &#39;?&#39;, &#39;!&#39;, &#39; &#39;, &#39;;&#39;, &#39;:&#39;, &#39;,&#39;},&lt;br /&gt;StringSplitOptions.RemoveEmptyEntries);&lt;br /&gt;// Group each word based on the occurecnces&lt;br /&gt;var groupItems = from word in inputTextArray&lt;br /&gt;orderby word&lt;br /&gt;group word by word into wordValueandCountPair&lt;br /&gt;select new { Key = wordValueandCountPair.Key, Count = wordValueandCountPair.Count() };&lt;br /&gt;char[] atozCharArray =&lt;br /&gt;Enumerable.Range(&#39;a&#39;, &#39;z&#39; - &#39;a&#39; + 1).Select(i =&gt; (Char)i).ToArray();&lt;br /&gt;int indexCount = 0;&lt;br /&gt;int iteration = 0;&lt;br /&gt;string indexString = string.Empty;&lt;br /&gt;// Print each word in the desired output format.&lt;br /&gt;foreach (var item in groupItems)&lt;br /&gt;{&lt;br /&gt;// Get the number of sentences.&lt;br /&gt;string[] SentenceArray =&lt;br /&gt;Regex.Split(strString.ToLower(), @&quot;(?&lt;=[&#39;&quot;&quot;a-z0-9][\.\!\?])\s+(?=[a-z])&quot;);&lt;br /&gt;string paraIndexString = string.Empty;&lt;br /&gt;// Loop through each sentence and find the occurence of the each word&lt;br /&gt;// in that sentence to identify the senetence number.&lt;br /&gt;for (int index = 0; index &lt; SentenceArray.Length; index++)&lt;br /&gt;{&lt;br /&gt;var paraItems =&lt;br /&gt;from paraItem in SentenceArray[index].Split(new char[] { &#39;.&#39;, &#39;?&#39;, &#39;!&#39;, &#39; &#39;, &#39;;&#39;, &#39;:&#39;, &#39;,&#39; }, StringSplitOptions.RemoveEmptyEntries)&lt;br /&gt;where paraItem == item.Key&lt;br /&gt;group paraItem by item.Key into paraIndexandCountPair&lt;br /&gt;select new { Key = paraIndexandCountPair.Key, Count = paraIndexandCountPair.Count() };&lt;br /&gt;// Get the occurences of each word in the selected sentence&lt;br /&gt;foreach (var worditem in paraItems)&lt;br /&gt;{&lt;br /&gt;for (int count = 0; count &lt; worditem.Count; count++)&lt;br /&gt;{&lt;br /&gt;if (!string.IsNullOrEmpty(paraIndexString))&lt;br /&gt;{&lt;br /&gt;paraIndexString = string.Format(&quot;{0},{1}&quot;, paraIndexString, (index + 1).ToString());&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;paraIndexString = (index + 1).ToString();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;if (indexCount == atozCharArray.Length)&lt;br /&gt;{&lt;br /&gt;indexCount = 0;&lt;br /&gt;iteration++;&lt;br /&gt;indexString =&lt;br /&gt;GetIndexString(atozCharArray[indexCount++], (iteration+1));&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;indexString =&lt;br /&gt;GetIndexString(atozCharArray[indexCount++], (iteration+1));&lt;br /&gt;}&lt;br /&gt;string outPutString =&lt;br /&gt;string.Format(&quot;{0,-15:D}&quot;, item.Key.ToString()) + &quot;{&quot; +&lt;br /&gt;string.Format(&quot;{0}:{1}&quot;, item.Count.ToString(), paraIndexString) + &quot;}&quot;;&lt;br /&gt;string FormattedoutPutString =&lt;br /&gt;string.Format(&quot;{0,-5:D} {1}&quot;, indexString, outPutString);&lt;br /&gt;Console.WriteLine(FormattedoutPutString);&lt;br /&gt;}&lt;br /&gt;Console.WriteLine(&quot;Press any key to exit.&quot;);&lt;br /&gt;Console.ReadKey();&lt;br /&gt;}&lt;br /&gt;/// &lt;method method=&quot;&quot;&gt;Method Name: GetIndexString&lt;/method&gt;&lt;br /&gt;/// &lt;description description=&quot;&quot;&gt;Description: &lt;para&gt;&lt;br /&gt;/// This method returns the formatted string based on the input character&lt;br /&gt;/// and number of character .&lt;/para&gt;&lt;/description&gt;&lt;br /&gt;/// &lt;param name=&quot;charachterToPrint&quot;&gt;Parameter: char charachterToPrint&lt;para&gt;&lt;br /&gt;/// This parameter is the character toprint.&lt;/para&gt;&lt;/param&gt;&lt;br /&gt;/// &lt;param name=&quot;charachterToPrint&quot;&gt;Parameter: int charachterCount&lt;para&gt;&lt;br /&gt;/// This parameter is the character count to format the output.&lt;/para&gt;&lt;/param&gt;&lt;br /&gt;/// &lt;return return=&quot;&quot;&gt;Returns:&lt;br /&gt;/// &lt;para&gt; - Returns the formatted string such as a. b. .... aa. bb..&lt;br /&gt;/// &lt;/para&gt;&lt;/return&gt;&lt;br /&gt;/// &lt;end/&gt;&lt;br /&gt;static string GetIndexString(char charachterToPrint, int charachterCount)&lt;br /&gt;{&lt;br /&gt;string charachterToPrintString = string.Empty;&lt;br /&gt;if (charachterCount != 0)&lt;br /&gt;{&lt;br /&gt;char[] charachterToPrintArray = new char[charachterCount];&lt;br /&gt;for (int count = 0; count &lt; charachterCount; count++)&lt;br /&gt;{&lt;br /&gt;charachterToPrintArray[count] = charachterToPrint;&lt;br /&gt;}&lt;br /&gt;charachterToPrintString =&lt;br /&gt;string.Format(&quot;{0}{1}&quot;, new string(charachterToPrintArray), &quot;.&quot;);&lt;br /&gt;}&lt;br /&gt;return charachterToPrintString;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}</content><link rel='replies' type='application/atom+xml' href='http://gudurin.blogspot.com/feeds/5184664076090608415/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1819512445879631740/5184664076090608415' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1819512445879631740/posts/default/5184664076090608415'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1819512445879631740/posts/default/5184664076090608415'/><link rel='alternate' type='text/html' href='http://gudurin.blogspot.com/2009/06/concordance-implementation-in-c30.html' title='Concordance implementation in C#3.0'/><author><name>Naresh Guduri Blog</name><uri>http://www.blogger.com/profile/02461913656830998473</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry></feed>