all interview questions

82
Short Answer .NET Interview Questions (PAGE 1) Q1. Explain the differences between Server-side and Client- side code? Ans. Server side code will execute at server (where the website is hosted) end, & all the business logic will execute at server end where as client side code will execute at client side (usually written in javascript, vbscript, jscript) at browser end. Q2. What type of code (server or client) is found in a Code- Behind class? Ans. Server side code. Q3. How to make sure that value is entered in an asp:Textbox control? Ans. Use a RequiredFieldValidator control. Q4. Which property of a validation control is used to associate it with a server control on that page? Ans. ControlToValidate property. Q5. How would you implement inheritance using VB.NET & C#? Ans. C# Derived Class : Baseclass VB.NEt : Derived Class Inherits Baseclass Q6. Which method is invoked on the DataAdapter control to load the generated dataset with data? Ans. Fill() method. Q7. What method is used to explicitly kill a user's session? Ans. Session.Abandon() Q8. What property within the asp:gridview control is changed to bind columns manually? Ans. Autogenerated columns is set to false Q9. Which method is used to redirect the user to another

Upload: ankit-kharkwal

Post on 07-Sep-2014

138 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: All Interview Questions

Short Answer .NET Interview Questions (PAGE 1)

Q1. Explain the differences between Server-side and Client-side code? Ans. Server side code will execute at server (where the website is hosted) end, & all the business logic will execute at server end where as client side code will execute at client side (usually written in javascript, vbscript, jscript) at browser end.

Q2. What type of code (server or client) is found in a Code-Behind class? Ans. Server side code.

Q3. How to make sure that value is entered in an asp:Textbox control?Ans. Use a RequiredFieldValidator control.

Q4. Which property of a validation control is used to associate it with a server control on that page?Ans. ControlToValidate property.

Q5. How would you implement inheritance using VB.NET & C#? Ans. C# Derived Class : Baseclass VB.NEt : Derived Class Inherits Baseclass

Q6. Which method is invoked on the DataAdapter control to load the generated dataset with data?Ans. Fill() method.

Q7. What method is used to explicitly kill a user's session? Ans. Session.Abandon()

Q8. What property within the asp:gridview control is changed to bind columns manually? Ans. Autogenerated columns is set to false

Q9. Which method is used to redirect the user to another page without performing a round trip to the client? Ans. Server.Transfer method.

Q10. How do we use different versions of private assemblies in same application without re-build? Ans.Inside the Assemblyinfo.cs or Assemblyinfo.vb file, we need to specify assembly version. assembly: AssemblyVersion

Q11. Is it possible to debug java-script in .NET IDE? If yes, how? Ans. Yes, simply write "debugger" statement at the point where the breakpoint needs to be set within the javascript code and also enable javascript debugging in the browser property settings.

Page 2: All Interview Questions

Q12. How many ways can we maintain the state of a page? Ans. 1. Client Side - Query string, hidden variables, viewstate, cookies2. Server side - application , cache, context, session, database

Q13. What is the use of a multicast delegate? Ans. A multicast delegate may be used to call more than one method.

Q14. What is the use of a private constructor? Ans. A private constructor may be used to prevent the creation of an instance for a class.

Q15. What is the use of Singleton pattern? Ans. A Singleton pattern .is used to make sure that only one instance of a class exists.

Q16. When do we use a DOM parser and when do we use a SAX parser?Ans. The DOM Approach is useful for small documents in which the program needs to process a large portion of the document whereas the SAX approach is useful for large documents in which the program only needs to process a small portion of the document.

Q17. Will the finally block be executed if an exception has not occurred?Ans.Yes it will execute.

Q18. What is a Dataset?Ans. A dataset is an in memory database kindof object that can hold database information in a disconnected environment.

Q19. Is XML a case-sensitive markup language? Ans. Yes.

Q20. What is an .ashx file?Ans. It is a web handler file that produces output to be consumed by an xml consumer client (rather than a browser).

Short Answer .NET Interview Questions (PAGE 2)

Q21. What is encapsulation?Ans. Encapsulation is the OOPs concept of binding the attributes and behaviors in a class, hiding the implementation of the class and exposing the functionality.

Q22. What is Overloading?Ans. When we add a new method with the same name in a same/derived class but with different number/types of parameters, the concept is called overluoad and this ultimately implements Polymorphism.

Q23. What is Overriding?Ans. When we need to provide different implementation in a child class than the one

Page 3: All Interview Questions

provided by base class, we define the same method with same signatures in the child class and this is called overriding.

Q24. What is a Delegate? Ans. A delegate is a strongly typed function pointer object that encapsulates a reference to a method, and so the function that needs to be invoked may be called at runtime.

Q25. Is String a Reference Type or Value Type in .NET? Ans. String is a Reference Type object.

Q26. What is a Satellite Assembly? Ans. Satellite assemblies contain resource files corresponding to a locale (Culture + Language) and these assemblies are used in deploying an application globally for different languages.

Q27. What are the different types of assemblies and what is their use?Ans. Private, Public(also called shared) and Satellite Assemblies.

Q28. Are MSIL and CIL the same thing?Ans. Yes, CIL is the new name for MSIL.

Q29. What is the base class of all web forms?Ans. System.Web.UI.Page

Q30. How to add a client side event to a server control?Ans. Example... BtnSubmit.Attributes.Add("onclick","javascript:fnSomeFunctionInJavascript()");

Q31. How to register a client side script from code-behind?Ans. Use the Page.RegisterClientScriptBlock method in the server side code to register the script that may be built using a StringBuilder.

Q32. Can a single .NET DLL contain multiple classes?Ans. Yes, a single .NET DLL may contain any number of classes within it.

Q33. What is DLL Hell?Ans. DLL Hell is the name given to the problem of old unmanaged DLL's due to which there was a possibility of version conflict among the DLLs.

Q34. can we put a break statement in a finally block?Ans. The finally block cannot have the break, continue, return and goto statements.

Q35. What is a CompositeControl in .NET?Ans. CompositeControl is an abstract class in .NET that is inherited by those web controls that contain child controls within them.

Page 4: All Interview Questions

Q36. Which control in asp.net is used to display data from an xml file and then displayed using XSLT?Ans. Use the asp:Xml control and set its DocumentSource property for associating an xml file, and set its TransformSource property to set the xml control's xsl file for the XSLT transformation.

Q37. Can we run ASP.NET 1.1 application and ASP.NET 2.0 application on the same computer?Ans. Yes, though changes in the IIS in the properties for the site have to be made during deployment of each.

Q38. What are the new features in .NET 2.0? Ans. Plenty of new controls, Generics, anonymous methods, partial classes, iterators, property visibility (separate visibility for get and set) and static classes.

Q39. Can we pop a MessageBox in a web application?Ans. Yes, though this is done clientside using an alert, prompt or confirm or by opening a new web page that looks like a messagebox.

Q40. What is managed data?Ans. The data for which the memory management is taken care by .Net runtime’s garbage collector, and this includes tasks for allocation de-allocation.

Q41. How to instruct the garbage collector to collect unreferenced data?Ans. We may call the garbage collector to collect unreferenced data by executing the System.GC.Collect() method.

Q42. How can we set the Focus on a control in ASP.NET?Ans. txtBox123.Focus(); OR Page.SetFocus(NameOfControl);

Q43. What are Partial Classes in Asp.Net 2.0?Ans. In .NET 2.0, a class definition may be split into multiple physical files but partial classes do not make any difference to the compiler as during compile time, the compiler groups all the partial classes and treats them as a single class.

Q44. How to set the default button on a Web Form? Ans. <asp:form id="form1" runat="server" defaultbutton="btnGo"/>

Q45.Can we force the garbage collector to run?Ans. Yes, using the System.GC.Collect(), the garbage collector is forced to run in case required to do so.

Q46. What is Boxing and Unboxing?Ans. Boxing is the process where any value type can be implicitly converted to a reference type object while Unboxing is the opposite of boxing process where the reference type is converted to a value type.

Page 5: All Interview Questions

Q47. What is Code Access security? What is CAS in .NET?Ans. CAS is the feature of the .NET security model that determines whether an application or a piece of code is permitted to run and decide the resources it can use while running.

Q48. What is Multi-tasking?Ans. It is a feature of operating systems through which multiple programs may run on the operating system at the same time, just like a scenario where a Notepad, a Calculator and the Control Panel are open at the same time.

Q49. What is Multi-threading?Ans. When an application performs different tasks at the same time, the application is said to exhibit multithreading as several threads of a process are running.2

Q50. What is a Thread?Ans. A thread is an activity started by a process and its the basic unit to which an operating system allocates processor resources.

Q51. What does AddressOf in VB.NET operator do?Ans. The AddressOf operator is used in VB.NET to create a delegate object to a method in order to point to it.

Q52. How to refer to the current thread of a method in .NET?Ans. In order to refer to the current thread in .NET, the Thread.CurrentThread method can be used. It is a public static property.

Q53. How to pause the execution of a thread in .NET?Ans. The thread execution can be paused by invoking the Thread.Sleep(IntegerValue) method where IntegerValue is an integer that determines the milliseconds time frame for which the thread in context has to sleep.

Q54. How can we force a thread to sleep for an infinite period?Ans. Call the Thread.Interupt() method.

Q55. What is Suspend and Resume in .NET Threading?Ans. Just like a song may be paused and played using a music player, a thread may be paused using Thread.Suspend method and may be started again using the Thread.Resume method. Note that sleep method immediately forces the thread to sleep whereas the suspend method waits for the thread to be in a persistable position before pausing its activity.

Q56. How can we prevent a deadlock in .Net threading?Ans. Using methods like Monitoring, Interlocked classes, Wait handles, Event raising from between threads, using the ThreadState property.

Page 6: All Interview Questions

Q57. What is Ajax?Ans. Asyncronous Javascript and XML - Ajax is a combination of client side technologies that sets up asynchronous communication between the user interface and the web server so that partial page rendering occur instead of complete page postbacks.

Q58. What is XmlHttpRequest in Ajax?Ans. It is an object in Javascript that allows the browser to communicate to a web server asynchronously without making a postback.

Q59. What are the different modes of storing an ASP.NET session?Ans. InProc (the session state is stored in the memory space of the Aspnet_wp.exe process but the session information is lost when IIS reboots), StateServer (the Session state is serialized and stored in a separate process call Viewstate is an object in .NET that automatically persists control setting values across the multiple requests for the same page and it is internally maintained as a hidden field on the web page though its hashed for security reasons.

Q60. What is a delegate in .NET?Ans. A delegate in .NET is a class that can have a reference to a method, and this class has a signature that can refer only those methods that have a signature which complies with the class.

Short Answer .NET Interview Questions (PAGE 4)

Q61. Is a delegate a type-safe functions pointer?Ans. Yes

Q62. What is the return type of an event in .NET?Ans. There is No return type of an event in .NET.

Q63. Is it possible to specify an access specifier to an event in .NET?Ans. Yes, though they are public by default.

Q64. Is it possible to create a shared event in .NET?Ans. Yes, but shared events may only be raised by shared methods.

Q65. How to prevent overriding of a class in .NET?Ans. Use the keyword NotOverridable in VB.NET and sealed in C#.

Q66. How to prevent inheritance of a class in .NET?Ans. Use the keyword NotInheritable in VB.NET and sealed in C#.

Q67. What is the purpose of the MustInherit keyword in VB.NET?Ans. MustInherit keyword in VB.NET is used to create an abstract class.

Page 7: All Interview Questions

Q68. What is the access modifier of a member function of in an Interface created in .NET?Ans. It is always public, we cant use any other modifier other than the public modifier for the member functions of an Interface.

Q69. What does the virtual keyword in C# mean?Ans. The virtual keyword signifies that the method and property may be overridden.

Q70. How to create a new unique ID for a control?Ans. ControlName.ID = "ControlName" + Guid.NewGuid().ToString(); //Make use of the Guid class

Q71A. What is a HashTable in .NET?Ans. A Hashtable is an object that implements the IDictionary interface, and can be used to store key value pairs. The key may be used as the index to access the values for that index.

Q71B. What is an ArrayList in .NET?Ans. Arraylist object is used to store a list of values in the form of a list, such that the size of the arraylist can be increased and decreased dynamically, and moreover, it may hold items of different types. Items in an arraylist may be accessed using an index.

Q72. What is the value of the first item in an Enum? 0 or 1?Ans. 0

Q73. Can we achieve operator overloading in VB.NET?Ans. Yes, it is supported in the .NET 2.0 version, the "operator" keyword is used.

Q74. What is the use of Finalize method in .NET?Ans. .NET Garbage collector performs all the clean up activity of the managed objects, and so the finalize method is usually used to free up the unmanaged objects like File objects, Windows API objects, Database connection objects, COM objects etc.

Q75. How do you save all the data in a dataset in .NET?Ans. Use the AcceptChanges method which commits all the changes made to the dataset since last time Acceptchanges was performed.

Q76. Is there a way to suppress the finalize process inside the garbage collector forcibly in .NET?Ans. Use the GC.SuppressFinalize() method.

Q77. What is the use of the dispose() method in .NET?Ans. The Dispose method in .NET belongs to IDisposable interface and it is best used to release unmanaged objects like File objects, Windows API objects, Database connection objects, COM objects etc from the memory. Its performance is better than the finalize()

Page 8: All Interview Questions

method.

Q78. Is it possible to have have different access modifiers on the get and set methods of a property in .NET?Ans. No we can not have different modifiers of a common property, which means that if the access modifier of a property's get method is protected, and it must be protected for the set method as well.

Q79. In .NET, is it possible for two catch blocks to be executed in one go?Ans. This is NOT possible because once the correct catch block is executed then the code flow goes to the finally block.

Q80. Is there any difference between System.String and System.StringBuilder classes?Ans. System.String is immutable by nature whereas System.StringBuilder can have a mutable string in which plenty of processes may be performed.

Q81. What technique is used to figure out that the page request is a postback?Ans. The IsPostBack property of the page object may be used to check whether the page request is a postback or not. IsPostBack property is of the type Boolean.

Q82. Which event of the ASP.NET page life cycle completely loads all the controls on the web page?Ans. The Page_load event of the ASP.NET page life cycle assures that all controls are completely loaded. Even though the controls are also accessible in Page_Init event but here, the viewstate is incomplete.

Q83. How is ViewState information persisted across postbacks in an ASP.NET webpage?Ans. Using HTML Hidden Fields, ASP.NET creates a hidden field with an ID="__VIEWSTATE" and the value of the page's viewstate is encoded (hashed) for security.

Q84. What is the ValidationSummary control in ASP.NET used for?Ans. The ValidationSummary control in ASP.NET displays summary of all the current validation errors.

Q85. What is AutoPostBack feature in ASP.NET?Ans. In case it is required for a server side control to postback when any of its event is triggered, then the AutoPostBack property of this control is set to true.

Q86. What is the difference between Web.config and Machine.Config in .NET?Ans. Web.config file is used to make the settings to a web application, whereas Machine.config file is used to make settings to all ASP.NET applications on a server(the server machine).

Page 9: All Interview Questions

Q87. What is the difference between a session object and an application object?Ans. A session object can persist information between HTTP requests for a particular user, whereas an application object can be used globally for all the users.

Q88. Which control has a faster performance, Repeater or Datalist?Ans. Repeater.

Q89. Which control has a faster performance, Datagrid or Datalist?Ans. Datalist.

Q90. How to we add customized columns in a Gridview in ASP.NET?Ans. Make use of the TemplateField column.

Q91. Is it possible to stop the clientside validation of an entire page?Ans. Set Page.Validate = false;

Q92. Is it possible to disable client side script in validators?Ans. Yes. simply EnableClientScript = false.

Q93. How do we enable tracing in .NET applications?Ans. <%@ Page Trace="true" %>

Q94. How to kill a user session in ASP.NET?Ans. Use the Session.abandon() method.

Q95. Is it possible to perform forms authentication with cookies disabled on a browser?Ans. Yes, it is possible.

Q96. What are the steps to use a checkbox in a gridview?Ans. <ItemTemplate><asp:CheckBox id="CheckBox1" runat="server" AutoPostBack="True" OnCheckedChanged="Check_Clicked"></asp:CheckBox></ItemTemplate>

Q97. What are design patterns in .NET?Ans. A Design pattern is a repeatitive solution to a repeatitive problem in the design of a software architecture.

Q98. What is difference between dataset and datareader in ADO.NET?Ans. A DataReader provides a forward-only and read-only access to data, while the DataSet object can carry more than one table and at the same time hold the relationships between the tables. Also note that a DataReader is used in a connected architecture whereas a Dataset is used in a disconnected architecture.

Q99. Can connection strings be stored in web.config?

Page 10: All Interview Questions

Ans. Yes, in fact this is the best place to store the connection string information.

Q100. Whats the difference between web.config and app.config?Ans. Web.config is used for web based asp.net applications whereas app.config is used for windows based applications.

Within each stage of the life cycle of a page, the page raises events that you can handle to run your own code. For control events, you bind the event handler to the event, either declaratively using attributes such as onclick, or in code.

Pages also support automatic event wire-up, meaning that ASP.NET looks for methods with particular names and automatically runs those methods when certain events are raised. If the AutoEventWireup attribute of the @ Page directive is set to true (or if it is not defined, since by default it is true), page events are automatically bound to methods that use the naming convention of Page_event, such as Page_Load and Page_Init. For more information on automatic event wire-up, see ASP.NET Web Server Control Event Model.The following table lists the page life-cycle events that you will use most frequently. There are more events than those listed; however, they are not used for most page processing scenarios. Instead, they are primarily used by server controls on the ASP.NET Web page to initialize and render themselves. If you want to write your own ASP.NET server controls, you need to understand more about these stages. For information about creating custom controls, see Developing Custom ASP.NET Server Controls.

Page Event Typical Use

PreInit Use this event for the following: Check the IsPostBack property to determine whether this is the

first time the page is being processed. Create or re-create dynamic controls. Set a master page dynamically. Set the Theme property dynamically. Read or set profile property values.

Note:

If the request is a postback, the values of the controls have not yet been restored from

view state. If you set a control property at this stage, its value might be overwritten in the next event.

Init Raised after all controls have been initialized and any skin settings have been applied. Use this event to read or initialize control properties.

InitComplete Raised by the Page object. Use this event for processing tasks that require all initialization be complete.

PreLoad Use this event if you need to perform processing on your page or control before the Load event. Before the Page instance raises this event, it loads view state for itself and all controls, and then processes any postback data included with the Request instance.

Load The Page calls the OnLoad event method on the Page, then recursively does the same for each child control, which does the same for each of its child controls until the page and all controls are loaded.

Page 11: All Interview Questions

Use the OnLoad event method to set properties in controls and establish database connections.

Control events Use these events to handle specific control events, such as a Button control's Click event or a TextBox control's TextChanged event.

Note:In a postback request, if the page contains validator controls, check the IsValid property of the Page and of individual validation controls before performing any processing.

LoadComplete Use this event for tasks that require that all other controls on the page be loaded.

PreRender Before this event occurs: The Page object calls EnsureChildControls for each control and

for the page. Each data bound control whose DataSourceID property is set

calls its DataBind method. For more information, see Data Binding Events for Data-Bound Controls later in this topic.

The PreRender event occurs for each control on the page. Use the event to make final changes to the contents of the page or its controls.

SaveStateComplete Before this event occurs, ViewState has been saved for the page and for all controls. Any changes to the page or controls at this point will be ignored.Use this event perform tasks that require view state to be saved, but that do not make any changes to controls.

Render This is not an event; instead, at this stage of processing, the Page object calls this method on each control. All ASP.NET Web server controls have a Render method that writes out the control's markup that is sent to the browser.If you create a custom control, you typically override this method to output the control's markup. However, if your custom control incorporates only standard ASP.NET Web server controls and no custom markup, you do not need to override the Render method. For more information, see Developing Custom ASP.NET Server Controls.A user control (an .ascx file) automatically incorporates rendering, so you do not need to explicitly render the control in code.

Unload This event occurs for each control and then for the page. In controls, use this event to do final cleanup for specific controls, such as closing control-specific database connections.For the page itself, use this event to do final cleanup work, such as closing open files and database connections, or finishing up logging or other request-specific tasks.

Note:During the unload stage, the page and its controls have been rendered, so you cannot make further changes to the response stream. If you attempt to call a method such as the Response.Write method, the page will throw an exception.

 

Wondering what the new features in IIS 7.0 going to be? Here you go! you can get a glimpse of IIS 7.0 in this article.      IIS7 will ship with both Windows Vista and Windows Longhorn Server. It's obvious that Microsoft has put a lot of time and effort into this release and you can expect IIS7 to be the platform of choice as soon as people can get their servers upgraded. It includes a several new functionalities with very rich integration with ASP.NET.

Page 12: All Interview Questions

Feature 1: HttpModules and HttpHandlers can participate in all the requests i.e we can have a ASP.NET HttpModule for a JSP or PHP page even. Building HTTPmodules for authentication, authorization, logging, url-rewriting, auditing now will be very easy with .NET.

Feature 2: ASP.NET configuration can be integrated with IIS. IIS now uses the same web.config configuration model, which means you can have both configure ASP.NET and IIS in a single web.config file. You can now set things like default pages, IIS security, logging, etc within a web.config file and xcopy/ftp it to a server.

Feature 3: This has an integrated Admin UI tool that can manage both IIS and ASP.NET settings. Rich GUI supports settings for Membership, Roles and Profile providers. This tool also supports remote delegated admin over http -- which means you can point the rich-client admin tool at a shared host server and manage your users/roles/profile settings remotely over http.

Feature 4: It provides better request auditing and error debugging. A new functionality called "Failed Request Event Buffering" (affectionately known as "FREB") is introduced. This allows administrators to configure applications to automatically save request information anytime an error occurs during a request, or if a request takes longer than a specified amount of time to complete. This allows us to analyze what exactly happened during a request failure and what errors or exceptions have occurred. This can capture tracing messages generated within ASP.NET or within any component or class library that uses System.Diagnostics -- which makes it much easier for developers and admins to instrument and analyze what is going on with systems at runtimes.

Feature 5: It provides better configuration APIs and command-line tools. In addition to new config and admin APIs, we now have a great command-line admin story that you can use to set/modify/retrieve all configuration information as well as manage the server (start/stop individual apps, lookup their health state, register new apps, refresh SSL certs, etc). The class hierarchy in brief can be figured as:

Page 13: All Interview Questions

A code snippet uses the new .NET APIs to query IIS7 to list the active worker processes on the computer. It also lists the Requests and other details about the request like Url, Clinet IP address ..etc. ServerManager iisManager = new ServerManager();foreach(WorkerProcess w3wp in iisManager.WorkerProcesses) { Console.WriteLine("W3WP ({0})", w3wp.ProcessId); foreach (Request request in w3wp.GetRequests(0)) { Console.WriteLine("{0} - {1},{2},{3}", request.Url, request.ClientIPAddr, request.TimeElapsed, request.TimeInState); }}

Feature 7: Let us examine the new management UI. Here's what the new IIS Manager looks like:

Page 14: All Interview Questions

The first thing to notice is the new "Features View" which is shown above. While you can still use the "Content View" to show the files that make up your Web Site in the main pane of the tool, most of the time you'll be using the "Features View" to change site and application settings.

Page 15: All Interview Questions

Feature 8: "Actions" pane is a task-based pane shows you the most common tasks that are related to the currently selected object. For example, here's a close up of the "Actions" pane as it looks when the "Default Web Site" is the currently selected object.

Page 16: All Interview Questions

The contents of the "Actions" pane will naturally change as the selected object changes, but this pane is where you'll generally find links that lead you through most of your common admin tasks.

Feature 9: Modular Architecture

Unless you've been living under a rock somewhere for the past few years, you've heard about all the problems that IIS has had when it comes to security. In earlier versions of IIS, it was either installed or it wasn't. If IIS was installed then all the features were installed. In an attempt to minimize potential vulnerability, in IIS 6, the majority of features were disabled by default, but they still got installed. This time around Microsoft has taken the next logical step. IIS7 is almost completely modular. Take a look at the installation screen:

Now granted, I've installed everything to play around with it all, but on a production server, you now have the flexibility to install only the features you need. That way if you don't use CGI, then you don't need to worry about some new bug that someone finds in the CGI handler. You also won't need to install a patch and reboot, because the affected code was never even installed on your server so there's nothing to patch!

C# interview questions and answers

Page 17: All Interview Questions

What’s the advantage of using System.Text.StringBuilder over System.String? StringBuilder is more efficient in the cases, where a lot of manipulation is done to the text. Strings are immutable, so each time it’s being operated on, a new instance is created. Can you store multiple data types in System.Array? No. What’s the difference between the System.Array.CopyTo() and System.Array.Clone()? The first one performs a deep copy of the array, the second one is shallow. How can you sort the elements of the array in descending order? By calling Sort() and then Reverse() methods. What’s the .NET datatype that allows the retrieval of data by a unique key? HashTable. What’s class SortedList underneath? A sorted HashTable. Will finally block get executed if the exception had not occurred? Yes. What’s the C# equivalent of C++ catch (…), which was a catch-all statement for any possible exception? A catch block that catches the exception of type System.Exception. You can also omit the parameter data type in this case and just write catch {}. Can multiple catch blocks be executed? No, once the proper catch code fires off, the control is transferred to the finally block (if there are any), and then whatever follows the finally block. Why is it a bad idea to throw your own exceptions? Well, if at that point you know that an error has occurred, then why not write the proper code to handle that error instead of passing a new Exception object to the catch block? Throwing your own exceptions signifies some design flaws in the project. What’s a delegate? A delegate object encapsulates a reference to a method. In C++ they were referred to as function pointers. What’s a multicast delegate? It’s a delegate that points to and eventually fires off several methods. How’s the DLL Hell problem solved in .NET? Assembly versioning allows the application to specify not only the library it needs to run (which was available under Win32), but also the version of the assembly. What are the ways to deploy an assembly? An MSI installer, a CAB archive, and XCOPY command. What’s a satellite assembly? When you write a multilingual or multi-cultural application in .NET, and want to distribute the core application separately from the localized modules, the localized assemblies that modify the core application are called satellite assemblies. What namespaces are necessary to create a localized application? System.Globalization, System.Resources. What’s the difference between // comments, /* */ comments and /// comments? Single-line, multi-line and XML documentation comments. How do you generate documentation from the C# file commented properly with a command-line compiler? Compile it with a /doc switch. What’s the difference between <c> and <code> XML documentation tag? Single line code example and multiple-line code example. Is XML case-sensitive? Yes, so <Student> and <student> are different elements.

Page 18: All Interview Questions

What debugging tools come with the .NET SDK? CorDBG – command-line debugger, and DbgCLR – graphic debugger. Visual Studio .NET uses the DbgCLR. To use CorDbg, you must compile the original C# file using the /debug switch. What does the This window show in the debugger? It points to the object that’s pointed to by this reference. Object’s instance data is shown. What does assert() do? In debug compilation, assert takes in a Boolean condition as a parameter, and shows the error dialog if the condition is false. The program proceeds without any interruption if the condition is true. What’s the difference between the Debug class and Trace class? Documentation looks the same. Use Debug class for debug builds, use Trace class for both debug and release builds. Why are there five tracing levels in System.Diagnostics.TraceSwitcher? The tracing dumps can be quite verbose and for some applications that are constantly running you run the risk of overloading the machine and the hard drive there. Five levels range from None to Verbose, allowing to fine-tune the tracing activities. Where is the output of TextWriterTraceListener redirected? To the Console or a text file depending on the parameter passed to the constructor. How do you debug an ASP.NET Web application? Attach the aspnet_wp.exe process to the DbgClr debugger. What are three test cases you should go through in unit testing? Positive test cases (correct data, correct output), negative test cases (broken or missing data, proper handling), exception test cases (exceptions are thrown and caught properly). Can you change the value of a variable while debugging a C# application? Yes, if you are debugging via Visual Studio.NET, just go to Immediate window. Explain the three services model (three-tier application). Presentation (UI), business (logic and underlying code) and data (from storage or other sources). What are advantages and disadvantages of Microsoft-provided data provider classes in ADO.NET? SQLServer.NET data provider is high-speed and robust, but requires SQL Server license purchased from Microsoft. OLE-DB.NET is universal for accessing other sources, like Oracle, DB2, Microsoft Access and Informix, but it’s a .NET layer on top of OLE layer, so not the fastest thing in the world. ODBC.NET is a deprecated layer provided for backward compatibility to ODBC engines. What’s the role of the DataReader class in ADO.NET connections? It returns a read-only dataset from the data source when the command is executed. What is the wildcard character in SQL? Let’s say you want to query database with LIKE for all employees whose name starts with La. The wildcard character is %, the proper query with LIKE would involve ‘La%’. Explain ACID rule of thumb for transactions. Transaction must be Atomic (it is one unit of work and does not dependent on previous and following transactions), Consistent (data is either committed or roll back, no “in-between” case where something has been updated and something hasn’t), Isolated (no transaction sees the intermediate results of the current transaction), Durable (the values persist if the data had been committed even if the system crashes right after). What connections does Microsoft SQL Server support? Windows Authentication (via Active Directory) and SQL Server authentication (via Microsoft SQL Server username and passwords).

Page 19: All Interview Questions

Which one is trusted and which one is untrusted? Windows Authentication is trusted because the username and password are checked with the Active Directory, the SQL Server authentication is untrusted, since SQL Server is the only verifier participating in the transaction. Why would you use untrusted verificaion? Web Services might use it, as well as non-Windows applications. What does the parameter Initial Catalog define inside Connection String? The database name to connect to. What’s the data provider name to connect to Access database? Microsoft.Access. What does Dispose method do with the connection object? Deletes it from the memory. What is a pre-requisite for connection pooling? Multiple processes must agree that they will share the same connection, where every parameter is the same, including the security settings.

What is .NET?.NET is essentially a framework for software development. It is similar in nature to any other software development framework (J2EE etc) in that it provides a set of runtime containers/capabilities, and a rich set of pre-built functionality in the form of class libraries and APIs The .NET Framework is an environment for building, deploying, and running Web Services and other applications. It consists of three main parts: the Common Language Runtime, the Framework classes, and ASP.NET.

How many languages .NET is supporting now? When .NET was introduced it came with several languages. VB.NET, C#, COBOL and Perl, etc. The site DotNetLanguages.Net says 44 languages are supported.

How is .NET able to support multiple languages? A language should comply with the Common Language Runtime standard to become a .NET language. In .NET, code is compiled to Microsoft Intermediate Language (MSIL for short). This is called as Managed Code. This Managed code is run in .NET environment. So after compilation to this IL the language is not a barrier. A code can call or use a function written in another language.

How ASP .NET different from ASP? Scripting is separated from the HTML, Code is compiled as a DLL, these DLLs can be executed on the server.

What is smart navigation? The cursor position is maintained when the page gets refreshed due to the server side validation and the page gets refreshed.

What is view state? The web is stateless. But in ASP.NET, the state of a page is maintained in the in the page itself automatically. How? The values are encrypted and saved in hidden controls. this is

Page 20: All Interview Questions

done automatically by the ASP.NET. This can be switched off / on for a single control

How do you validate the controls in an ASP .NET page? Using special validation controls that are meant for this. We have Range Validator, Email Validator.

Can the validation be done in the server side? Or this can be done only in the Client side?

Client side is done by default. Server side validation is also possible. We can switch off the client side and server side can be done.

How to manage pagination in a page? Using pagination option in DataGrid control. We have to set the number of records for a page, then it takes care of pagination by itself.

What is ADO .NET and what is difference between ADO and ADO.NET? ADO.NET is stateless mechanism. I can treat the ADO.Net as a separate in-memory database where in I can use relationships between the tables and select insert and updates to the database. I can update the actual database as a batch.

Observations between VB.NET and VC#.NET? Choosing a programming language depends on your language experience and the scope of the application you are building. While small applications are often created using only one language, it is not uncommon to develop large applications using multiple languages.

For example, if you are extending an application with existing XML Web services, you might use a scripting language with little or no programming effort. For client-server applications, you would probably choose the single language you are most comfortable with for the entire application. For new enterprise applications, where large teams of developers create components and services for deployment across multiple remote sites, the best choice might be to use several languages depending on developer skills and long-term maintenance expectations.

The .NET Platform programming languages - including Visual Basic .NET, Visual C#, and Visual C++ with managed extensions, and many other programming languages from various vendors - use .NET Framework services and features through a common set of unified classes. The .NET unified classes provide a consistent method of accessing the platform's functionality. If you learn to use the class library, you will find that all tasks follow the same uniform architecture. You no longer need to learn and master different API architectures to write your applications.

In most situations, you can effectively use all of the Microsoft programming languages. Nevertheless, each programming language has its relative strengths and you will want to understand the features unique to each language. The following sections will help you

Page 21: All Interview Questions

choose the right programming language for your application.

Visual Basic .NETVisual Basic .NET is the next generation of the Visual Basic language from Microsoft. With Visual Basic you can build .NET applications, including Web services and ASP.NET Web applications, quickly and easily. Applications made with Visual Basic are built on the services of the common language runtime and take advantage of the .NET Framework.

Visual Basic has many new and improved features such as inheritance, interfaces, and overloading that make it a powerful object-oriented programming language. Other new language features include free threading and structured exception handling. Visual Basic fully integrates the .NET Framework and the common language runtime, which together provide language interoperability, garbage collection, enhanced security, and improved versioning support. A Visual Basic support single inheritance and creates Microsoft intermediate language (MSIL) as input to native code compilers.

Visual Basic is comparatively easy to learn and use, and Visual Basic has become the programming language of choice for hundreds of thousands of developers over the past decade. An understanding of Visual Basic can be leveraged in a variety of ways, such as writing macros in Visual Studio and providing programmability in applications such as Microsoft Excel, Access, and Word.

Visual Basic provides prototypes of some common project types, including:• Windows Application.• Class Library.• Windows Control Library.• ASP.NET Web Application.• ASP.NET Web Service.• Web Control Library.• Console Application.• Windows Service.• Windows Service.Visual C# .NET

Visual C# (pronounced C sharp) is designed to be a fast and easy way to create .NET applications, including Web services and ASP.NET Web applications. Applications written in Visual C# are built on the services of the common language runtime and take full advantage of the .NET Framework.

C# is a simple, elegant, type-safe, object-oriented language recently developed by Microsoft for building a wide range of applications. Anyone familiar with C and similar languages will find few problems in adapting to C#. C# is designed to bring rapid development to the C++ programmer without sacrificing the power and control that are a hallmark of C and C++. Because of this heritage, C# has a high degree of fidelity with C

Page 22: All Interview Questions

and C++, and developers familiar with these languages can quickly become productive in C#. C# provides intrinsic code trust mechanisms for a high level of security, garbage collection, and type safety. C# supports single inheritance and creates Microsoft intermediate language (MSIL) as input to native code compilers.

C# is fully integrated with the .NET Framework and the common language runtime, which together provide language interoperability, garbage collection, enhanced security, and improved versioning support. C# simplifies and modernizes some of the more complex aspects of C and C++, notably namespaces, classes, enumerations, overloading, and structured exception handling. C# also eliminates C and C++ features such as macros, multiple inheritaance, and virtual base classes. For current C++ developers, C# provides a powerful, high-productivity language alternative.

Visual C# provides prototypes of some common project types, including:• Windows Application.• Class Library.• Windows Control Library.• ASP.NET Web Application.• ASP.NET Web Service.• Web Control Library.• Console Application.• Windows Service.

Question:-What do you mean by Share Point Portal ?Answer: Here I have taken information regarding  Share Point Portal Server 2003 provides mainly access to the crucial business information and applications.With the help of Share Point Server we can server  information between  Public Folders, Data Bases, File Servers  and the websites that are based on Windows server 2003. This Share Point Portal is  integrated with MSAccess and Windows servers,So we can get  a Wide range of document management functionality. We can also create a full featured portal with readymade navigation and structure.Question:-What is cross page posting in ASP.NET2.0 ?Answer: When we have to post data from one page to another in application we used server.transfer method but in this the URL remains the same but in cross page posting there is little different there is normal post back is done but in target page we can access values of server control in the source page.This is quite simple we have to only set the PostBackUrl property of Button,LinkButton or imagebutton which specifies the target page.In target page we can access the PreviousPage property.And we have to use the @PreviousPageType directive.We can access control of PreviousPage by using the findcontrol method.When we set the PostBackURL property ASP.NET framework bind the HTML and Javascript function automatically.

Question:-How to call method that handles the Click event for several buttons ?Answer: Protected Sub AnyClicked(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click, Button2.Click, Button3.ClickDim b As Button = CType(sender, Button)Response.Write("You clicked the button labeled " & b.ID) End Sub

Page 23: All Interview Questions

Question: What do you mean by CodeDom ?Answer: In a simple language CodeDom is an object model which display or represent source code.CodeDom is specially designed for language independent. And the method is quite simple when we create CodeDom for a program we can generate the source code in any .NET language.

Question: Difference between System exceptions and Application exceptions ?Answer: In ASP.NET all exception derives from Exception which is Base class. Exceptions can be generated programmatically or can be generated by system. Application Exception serves as the base class for all applicationspecific exception classes. It derives from Exception but does not provide any extended functionality. You should derive your custom application exceptions from Application Exception. Application exception is used when we want to define user defined exception, while system exception is all which is defined by .NET.

Question: What is the difference between Shadowing and overriding ?Answer: Overriding redefines only the implementation while shadowing redefines the whole element.On the other side In overriding derived classes can refer the parent class element by using “ME” keyword, but in shadowing you can access it by “MYBASE”.

Question: What is the use of App_Code folder in asp.net ?Answer: :- Its name helps us to understand what is this in another way we can say that its automatically accessible in the application. App_Code Folder store classes, typed data set, text files, Reports etc. If we don’t have this folder in web application we can add this folder. One of more significant feature of this is a single dll is created of this folder. If we have two different language classes in this folder then we have to create two folder one for one language.

Question: What is diffrence between Debug and Trace class ?Answer: Debug Class helps to set methods and properties that helps in debugging code. If we use methods in Debug class for print debugging information and checking our logic with cases, we can make our code more robust without impacting the performance and code size. On the other side we use the properties and methods in the Trace class to release builds and instrumentation allows us to monitor the condition of our application running in real-life settings. Tracing helps us to know problems and fix them without interact a running system. Trace is enabled by default in visual 2005. So code is generated for all trace methods in both release and debug builds.

Question: What do you mean by Web Part Control in asp.net ?Answer: ASP.NET Web Parts controls are the integrated controls which helps in creation of Web sites that also help users to modify the content as well as appearance, and behavior of pages of web sites that are open in browser.

Question: What changes are done in IIS 6.0 over IIS 5.0 ?Answer: IIS makes easy to get information.IIS 6.0 is the next latest of web server available in Windows Server 2003 platform. IIS 6.0 contains several enhancements over IIS 5.0 that are mainly to increase reliability, manageability, scalability, and security. IIS 6.0 is a key component of the Windows Server 2003 application platform, using which you can develop and deploy high performance ASP.NET Web applications, and XML Web Services.

Question: Com Marshler function in .NET ?Answer: Com Marshler is useful component of CLR.Main work of marshal data between Managed and Unmanaged environment .It helps in representation of data accross diffrenet execution enviroment.Its also convert data format between manage and unmanaged code.By the helps of Com Marshlar CLR allows manage code to interoperate with unmanaged code.

Question: How Visual SourceSafe helps Us ?Answer: One of the powerful tool provided by Microsoft to keep up-to-date of files system its

Page 24: All Interview Questions

keeps records of file history once we add files to source safe it can be add to database and the changes ade by diffrenet user to this files are maintained in database from that we can get the older version of files to.This also helps in sharing,merging of files.

Question: What is main difference between GridLayout and FormLayout ?Answer: GridLayout helps in providing absolute positioning of every control placed on the page.It is easier to devlop page with absolute positioning because control can be placed any where according to our requirement.But FormLayout is little different only experience Web Devloper used this one reason is it is helpful for wider range browser.If there is absolute positioning we can notice that there are number of DIV tags.But in FormLayout whole work are done through the tables.

Question: What is the purpose of IIS ?Answer: We can call IIS(Internet Information Services) a powerful Web server that helps us creating highly reliable, scalable and manageable infrastructure for Web application which runs on Windows Server 2003. IIS helps development center and increase Web site and application availability while lowering system administration costs. It also runs on Windows NT/2000 platforms and also for above versions. With IIS, Microsoft includes a set of programs for building and administering Web sites, a search engine, and support for writing Web-based applications that access database. IIS also called http server since it process the http request and gets http response.

Question: How to start Outlook,NotePad file in AsP.NET with code ?Answer: Here is the syntax to open outlook or notepad file in ASP.NET VB.NET Process.Start("Notepad.exe") Process.Start("msimn.exe"); C#.NET System.Diagnostics.Process.Start("msimn.exe"); System.Diagnostics.Process.Start("Notepad.exe");

Question: What you thing about the WebPortal ?Answer: Web portal is nothing but a page that allows a user to customize his/her homepage. We can use Widgets to create that portal we have only to drag and drop widgets on the page. The user can set his Widgets on any where on the page where he has to get them. Widgets are nothing but a page area that helps particular function to response. Widgets example are address books, contact lists, RSS feeds, clocks, calendars, play lists, stock tickers, weather reports, traffic reports, dictionaries, games and another such beautiful things that we can not imagine. We can also say Web Parts in Share Point Portal. These are one of Ajax-Powered.

Question:-Can you define what is SharePoint and some overview about this ?Answer: SharePoint helps workers for  creating  powerful personalized interfaces only by dragging and drop pre-defined Web Part Components. And these Web Parts components also helps non programmers to get information which care  and customize the appearance of Web pages. To under stand it we take an example  one Web Part might display a user's information another might create a graph showing current employee status  and a third might show a list of Employees Salary. This is also possible that each functions has a link to a video or audio presentation.So now  Developers are unable to  create these Web Part components and make them available to SharePoint users.

Question:-What is different between WebUserControl and in WebCustomControl ?Answer: Web user controls :- Web User Control is Easier to create and another thing is that its support is limited for users who use a visual design tool one gud thing is that its contains static layout one more thing a seprate copy is required for each application. Web custom controls:-Web Custom Control is typical to create and gud for dynamic layout and another thing is it have full tool support for user and a single copy of control is required because it is placed in Global Assembly cache.

Question:-What is Sandbox in SQL server and explain permission level in Sql Server ?Answer: Sandbox is place where we run trused program or script which is created  from

Page 25: All Interview Questions

the third party. There are three type of Sandbox where user code run.Safe Access Sandbox:-Here we can only create stored procedure,triggers,functions,datatypes etc.But we doesnot have acess memory ,disk etc.External Access Sandbox:-We cn access File systems outside the box. We can not play with threading,memory allocation etc.Unsafe Access Sandbox:-Here we can write unreliable and unsafe code.Question:-How many types of cookies are there in .NET ?Answer: Two type of cookeies.a) single valued eg request.cookies(”UserName”).value=”dotnetquestion”b)Multivalued cookies. These are used in the way collections are used examplerequest.cookies(”CookiName”)(”UserName”)=”dotnetquestionMahesh”request.cookies(”CookiName”)(”UserID”)=”interview″

Question: When we get Error 'HTTP 502 Proxy Error' ?Answer: We get this error when we execute ASP.NET Web pages in Visual Web Developer Web server, because the URL randomly select port number and proxy servers did not recognize the URL and return this error. To resolve this problem we have to change settings in Internet Explorer to bypass the proxy server for local addresses, so that the request is not sent to the proxy.

Question:-What do you mean by three-tier architecture?Answer: The three-tier architecture was comes into existence to improve management of code and contents and to improve the performance of the web based applications.There are mainly three layers in three-tier architecture.the are define as follows (1)Presentation (2)Business Logic (3)Database (1)First layer Presentation contains mainly the interface code, and this is shown to user. This code could contain any technology that can be used on the client side like HTML, JavaScript or VBScript etc.(2)Second layer is Business Logic which contains all the code of the server-side .This layer have code to interact with database database and to query, manipulate, pass data to user interface and handle any input from the UI as well. (3)Third layer Data represents the data store like MS Access, SQL Server, an XML file, an Excel file or even a text file containing data also some addtional database are also added to that layers.

Question: What is Finalizer in .NET define Dispose and Finalize ?Answer: We can say that Finalizer are the methods that's helps in cleanp the code that is executed before object is garbage collected .The process is called finalization . There are two methods of finalizer Dispose and Finalize .There is little diffrenet between two of this method .When we call Dispose method is realse all the resources hold by an object as well as all the resorces hold by the parent object.When we call Dispose method it clean managed as well as unmanaged resources.Finalize methd also cleans resources but finalize call dispose clears only the unmanged resources because in finalization the garbase collecter clears all the object hold by managed code so finalization fails to prevent thos one of methd is used that is: GC.SuppressFinalize.

Question: Define SMTPclient class in DotNet framework class libarary ?Answer: Each classes in dotnet framework inclue some properties,method and events.These properties ,methods and events are member of a class.SMTPclient class mainly concern with sending mail.This class contain the folling member.Properties:-Host:-The name or IP address of email server.

Page 26: All Interview Questions

Port:-Port that is use when sending mail.Methods:-Send:-Enables us to send email synchronously.SendAsynchronous:-Enables us to send an email asynchronously.Event:-SendCompleted:-This event raised when an asynchronous send opertion completes.

Question: What is late binding ?Answer: When code interacts with an object dynamically at runtime .because our code literally doesnot care what type of object it is interacting and with the methods thats are supported by object and with the methods thats are supported by object .The type of object is not known by the IDE or compiler ,no Intellisense nor compile-time syntax checking is possible but we get unprecedented flexibilty in exchange.if we enable strict type checking by using option strict on at the top of our code modules ,then IDE and compiler will enforce early binding behaviour .By default Late binding is done.

Question:-Does .NET CLR and SQL SERVER run in different process ?Answer: Dot Net CLR and all .net realtes application and Sql Server run in same process or we can say that that on the same address because there is no issue of speed because if these two process are run in different process then there may be a speed issue created one process goes fast and other slow may create the problem.

Question:-What is Com Marshler and its importance in .NET ?Answer: Com Marshler is one of useful component of CLR. Its Task is to marshal data between Managed and Unmanaged environment .It helps in representation of data accross diffrenet execution enviroment.It performs the conversion of data format between manage and unmanaged code.By the helps of Com Marshlar CLR allows manage code to interoperate with unmanaged code.

Question: What is CSU and its description ?Answer: CSU stands for comma separate values also called comma delimited.It is plain text file which stores spreadsheets or basic datatype in very simple format.One record in each line and each field separted with comma's it is often used to transfer large ammount spreadsheet data or database information between program.

Question: The IHttpHandler and IHttpHandlerFactory interfaces ?Answer: The IHttpHandler interface is implemented by all the handlers. The interface consists of one property called IsReusable. The IsReusable property gets a value indicating whether another request can use the IHttpHandler instance. The method ProcessRequest() allows you to process the current request. This is the core place where all your code goes. This method receives a parameter of type HttpContext using which you can access the intrinsic objects such as Request and Response. The IHttpHandlerFactory interface consists of two methods - GetHandler and ReleaseHandler. The GetHandler() method instantiates the required HTTP handler based on some condition and returns it back to ASP.NET. The ReleaseHandler() method allows the factory to reuse an existing handler.

Question: what is Viewstate? Answer:View state is used by the ASP.NET page framework to automatically save the values of the page and of each control just prior to rendering to the page. When the page is posted, one of the first tasks performed by page processing is to restore view state.

Page 27: All Interview Questions

State management is the process by which you maintain state and page information over multiple requests for the same or different pages. Client-side options are: * The ViewState property * Query strings* Hidden fields * CookiesServer-side options are:

* Application state * Session state * DataBaseUse the View State property to save data in a hidden field on a page. Because ViewState stores data on the page, it is limited to items that can be serialized. If you want to store more complex items in View State, you must convert the items to and from a string.ASP.NET provides the following ways to retain variables between requests:Context.Handler object Use this object to retrieve public members of one Web form’s class from a subsequently displayed Web form. Query strings Use these strings to pass information between requests and responses as part of the Web address. Query strings are visible to the user, so they should not contain secure information such as passwords. Cookies Use cookies to store small amounts of information on a client. Clients might refuse cookies, so your code has to anticipate that possibility. View state ASP.NET stores items added to a page’s ViewState property as hidden fields on the page.Session state Use Session state variables to store items that you want keep local to the current session (single user).Application state Use Application state variables to store items that you want be available to all users of the application. Question: DOTNET PAGE LIFECYCLE ?Answer: While excuting the page, it will go under the fallowing steps(or fires the events) which collectivly known as Page Life cycle.Page_Init -- Page InitializationLoadViewState -- View State LoadingLoadPostData -- Postback data processingPage_Load -- Page LoadingRaisePostDataChangedEvent -- PostBack Change NotificationRaisePostBackEvent -- PostBack Event HandlingPage_PreRender -- Page Pre Rendering PhaseSaveViewState -- View State SavingPage_Render -- Page Rendering Page_UnLoad -- Page Unloading

Question: What is Satellite Assemblies ?Answer: Satellite assemblies are often used to deploy language-specific resources for an application. These language-specific assemblies work in side-by-side execution because the application has a separate product ID for each language and installs satellite assemblies in a language-specific subdirectory for each language. When uninstalling, the application removes only the satellite assemblies associated with a given language and .NET Framework version. No core .NET Framework files are removed unless the last language for that .NET Framework version is being removed. For example, English and Japanese editions of the .NET Framework version 1.1 share the same core files. The Japanese .NET Framework version 1.1 adds satellite assemblies with localized resources in a \ja subdirectory. An application that supports the .NET Framework version 1.1, regardless of its language, always uses the same core runtime files.

Question: What is CAS ?Answer:CAS: CAS is the part of the .NET security model that determines whether or not a piece of code is allowed to run, and what resources it can use when it is running. For example, it is CAS that will prevent a .NET web applet from formatting your hard disk. How does CAS work? The CAS security policy revolves around two key concepts - code groups and permissions. Each .NET assembly is a member of a particular code group, and each code group

Page 28: All Interview Questions

is granted the permissions specified in a named permission set. For example, using the default security policy, a control downloaded from a web site belongs to the 'Zone - Internet' code group, which adheres to the permissions defined by the 'Internet' named permission set. (Naturally the 'Internet' named permission set represents a very restrictive range of permissions.) Question: Automatic Memory Management ?Answer: Automatic Memory Management: From a programmer's perspective, this is probably the single biggest benefit of the .NET Framework. No, I'm not kidding. Every project I've worked on in my long career of DOS and Windows development has suffered at some point from memory management issues. Proper memory management is hard. Even very good programmers have difficulty with it. It's entirely too easy for a small mistake to cause a program to chew up memory and crash, sometimes bringing the operating system to a screeching halt in the process.

Programmers understand that they're responsible for releasing any memory that they allocate, but they're not very good at actually doing it. In addition, functions that allocate memory as a side effect abound in the Windows API and in the C runtime library. It's nearly impossible for a programmer to know all of the rules. Even when the programmer follows the rules, a small memory leak in a support library can cause big problems if called enough.

The .NET Framework solves the memory management problems by implementing a garbage collector that can keep track of allocated memory references and release the memory when it is no longer referenced. A large part of what makes this possible is the blazing speed of today's processors. When you're running a 2 GHz machine, it's easy to spare a few cycles for memory management. Not that the garbage collector takes a huge number of cycles--it's incredibly efficient.The garbage collector isn't perfect and it doesn't solve the problem of mis-managing other scarce resources (file handles, for example), but it relieves programmers from having to worry about a huge source of bugs that trips almost everybody up in other programming environments.On balance, automatic memory management is a huge win in almost every situation.

Question: What Language familar to CLR?Answer: Any language that can be compiled into Microsoft Intermediate Language (MSIL) is considered a .NET-compliant language. Following are a few of the popular .NET-compliant languages supported by CLR:APL COBOL Component Pascal EiffelFortran Haskell JScript MercuryOberon Pascal Perl PythonSmalltalk Visual Basic Visual C# Visual C++

1. LINQ Support

LINQ essentially is the composition of many standard query operators that allow you to work with data in a more intuitive way regardless.

Page 29: All Interview Questions

The benefits of using LINQ are significant – Compile time checking C# language queries, and the ability to debug step by step through queries.

2. Expression Blend Support

Expression blend is XAML generator tool for silverlight applications. You can install Expression blend as an embedded plug-in to Visual Studio 2008. By this you can get extensive web designer and JavaScript tool.

3. Windows Presentation Foundation

WPF provides you an extensive graphic functionality you never seen these before. Visual Studio 2008 contains plenty of WPF Windows Presentation Foundation Library templates. By this a visual developer who is new to .NET, C# and VB.NET can easily develop the 2D and 3D graphic applications.

Visual Studio 2008 provides free game development library kits for games developers. currently this game development kits are available for C++ and also 2D/3D Dark Matter one image and sounds sets.

4. VS 2008 Multi-Targeting Support

Earlier you were not able to working with .NET 1.1 applications directly in visual studio 2005. Now in Visual studio 2008 you are able to create, run, debug the .NET 2.0, .NET 3.0 and .NET 3.5 applications. You can also deploy .NET 2.0 applications in the machines which contains only .NET 2.0 not .NET 3.x.

5. AJAX support for ASP.NET

Previously developer has to install AJAX control library separately that does not come from VS, but now if you install Visual Studio 2008, you can built-in AJAX control library. This Ajax Library contains

Page 30: All Interview Questions

plenty of rich AJAX controls like Menu, TreeView, webparts and also these components support JSON and VS 2008 contains in built ASP.NET AJAX Control Extenders.

6. JavaScript Debugging Support

Since starting of web development all the developers got frustration with solving javascript errors. Debugging the error in javascript is very difficult. Now Visual Studio 2008 makes it is simpler with javascript debugging. You can set break points and run the javaScript step by step and you can watch the local variables when you were debugging the javascript and solution explorer provides javascript document navigation support.

7. Nested Master Page Support

Already Visual Studio 2005 supports nested master pages concept with .NET 2.0, but the problem with this Visual Studio 2005 that pages based on nested masters can't be edited using WYSIWYG web designer. But now in VS 2008 you can even edit the nested master pages.

8. LINQ Intellisense and Javascript Intellisense support for silverlight applications

Most happy part for .NET developers is Visual Studio 2008 contains intellisense support for javascript. Javascript Intellisense makes developers life easy when writing client side validation, AJAX applications and also when writing Silverlight applications

Intellisense Support: When we are writing the LINQ Query VS provides LINQ query syntax as tool tips.

9. Organize Imports or Usings: We have Organize Imports feature already in Eclipse. SInce many days I have been waiting for this feature even in VS. Now VS contains Organize Imports feature which removes unnecessary namespaces which you have imported. You can select all the namespaces and right click on it, then you can get context menu with Organize imports options like "Remove Unused Usings", "Sort Usings", "Remove and Sort". Refactoring support for new .NET 3.x features like Anonymous types, Extension Methods, Lambda Expressions.

10. Intellisense Filtering: Earlier in VS 2005 when we were typing with intellisense box all the items were being displayed. For example If we type the letter 'K' then intellisense takes you to the items starts with 'K' but also all other items will be presented in intellisense box. Now in VS 2008 if you press 'K' only the items starts with 'K' will be filtered and displayed.

11. Intellisense Box display position

Page 31: All Interview Questions

Earlier in some cases when you were typing the an object name and pressing . (period) then intellisense was being displayed in the position of the object which you have typed. Here the code which we type will go back to the dropdown, in this case sometimes programmer may disturb to what he was typing. Now in VS 2008 If you hold the Ctrl key while the intellisense is dropping down then intellisense box will become semi-transparent mode.

12. Visual Studio 2008 Split View

VS 205 has a feature show both design and source code in single window. but both the windows tiles horizontally. In VS 2008 we can configure this split view feature to vertically, this allows developers to use maximum screen on laptops and wide-screen monitors.

Here one of the good feature is if you select any HTML or ASP markup text in source window automatically corresponding item will be selected in design window.

13. HTML JavaScript warnings, not as errors: VS 2005 mixes HTML errors and C# and VB.NET errors and shows in one window. Now VS 2008 separates this and shows javascript and HTML errors as warnings. But this is configurable feature.

14. Debugging .NET Framework Library Source Code:

Now in VS 2008 you can debug the source code of .NET Framework Library methods. Lets say If you want to debug the DataBind() method of DataGrid control you can place a debugging point over there and continue with debug the source code of DataBind() method.

15. In built Silverlight Library

Page 32: All Interview Questions

Earlier we used to install silverlight SDK separately, Now in VS 2008 it is inbuilt, with this you can create, debug and deploy the silverlight applications.

16. Visual Studio LINQ Designer

Already you know in VS 2005 we have inbuilt SQL Server IDE feature. by this you no need to use any other tools like SQL Server Query Analyzer and SQL Server Enterprise Manger. You have directly database explorer by this you can create connections to your database and you can view the tables and stored procedures in VS IDE itself. But now in VS 2008 it has View Designer window capability with LINQ-to-SQL.

17. Inbuilt C++ SDK

Earlier It was so difficult to download and configure the C++ SDK Libraries and tools for developing windows based applications. Now it is inbuilt with VS 2008 and configurable

18. Multilingual User Interface Architecture - MUI

Page 33: All Interview Questions

MUI is an architecture contains packages from Microsoft Windows and Microsoft Office libraries. This supports the user to change the text language display as he wish.

Visual Studio is now in English, Spanish, French, German, Italian, Chinese Simplified, Chinese Traditional, Japanese, and Korean. Over the next couple of months. Microsoft is reengineering the MUI which supports nine local languages then you can even view Visual studio in other 9 local languages.

19. Microsoft Popfly Support

Microsoft Popfly explorer is an add-on to VS 2008, by this directly you can deploy or hosting the Silverlight applications and Marshup objects

20. Free Tools and Resources

People may feel that I am a promoter to Visual Studio 2008 as a salesman, but we get plenty of free resources and free tools with Visual Studio 2008.

Visual Studio 2008 Trial 101 LINQ Samples Free .NET 3.5 control libraries with free sample programs, You can get plenty of free video training tutorials from Microsoft BDLC - Beginner Developer Learning Center, C++ games development library, Microsoft has provided lot of e-Books, P2P library and Microsoft is providing Coding4Fun sample program kit.

Page 34: All Interview Questions

Visual Studio Registration Discounts: If you register the Visual Studio you get Free Control Libraries, Books, Images, and Discounts. Download Visual Studio 2008 free trial 21. We can use for Commercial

Earlier you were spending lot of money to host your .NET applications for commercial use. Now you no need to worry Now Microsoft is providing you to host your application free on Popfly for web pages and also visual studio express projects.

How to Install SilverlightHere are the steps to Install silverlight

1. Open http://silverlight.net/Default.aspx

2. Open GET STARTED Page by clicking it.

3. Find out Download Silverlight Link (If already Silverlight is installed in your machine this link will not be appeared to you).

4 If you click on Download Silverlight Link, It opens Microsoft Silverlight Install Page http://www.microsoft.com/silverlight/install.aspx.

5. Click on Install Now Option then you can download the Silverlight Plug-in.

Page 35: All Interview Questions

5. Then Install Silverlight By using downloaded silverlight plug-in installable setup software.

6. While Installing Silverlight you can see the progress screen as bellow.

7. Restart all of your browsers

This silverlight installation can work for all the browsers like Internet Explorer, Mozilla, Opera.....

How to uninstall SilverlightBellow are the steps to follow to uninstall the silverlight

1. Go to Start menu.

2. Go to Control Panel

3. Open Add or Remove programs.

4. Choose Microsoft Silverlight in Add Remove Programs Dialog box.

5. Click on Remove

6. It asks you for the confirmation.

7. Click YES to Uninstall the Silverlight

You can see the Uninstalling silverlight in bellow image.

Page 36: All Interview Questions

  Transparent Data Encryption

Enable encryption of an entire database, data files, or log files, without the need for application changes. Benefits of this include: Search encrypted data using both range and fuzzy searches, search secure data from unauthorized users, and data encryption without any required changes in existing applications.

Extensible Key Management

SQL Server 2005 provides a comprehensive solution for encryption and key management. SQL Server 2008 delivers an excellent solution to this growing need by supporting third-party key management and HSM products.

Auditing

Create and manage auditing via DDL, while simplifying compliance by providing more comprehensive data auditing. This enables organizations to answer common questions, such as, "What data was retrieved?"

Page 37: All Interview Questions

Enhanced Database Mirroring

SQL Server 2008 builds on SQL Server 2005 by providing a more reliable platform that has enhanced database mirroring, including automatic page repair, improved performance, and enhanced supportability.

Automatic Recovery of Data Pages

SQL Server 2008 enables the principal and mirror machines to transparently recover from 823/824 types of data page errors by requesting a fresh copy of the suspect page from the mirroring partner transparently to end users and applications.

Log Stream Compression

Database mirroring requires data transmissions between the participants of the mirroring implementations. With SQL Server 2008, compression of the outgoing log stream between the participants delivers optimal performance and minimizes the network bandwidth used by database mirroring.

Resource Governor

Provide a consistent and predictable response to end users with the introduction of Resource Governor, allowing organizations to define resource limits and priorities for different workloads, which enable concurrent workloads to provide consistent performance to their end users.

Predictable Query Performance

Enable greater query performance stability and predictability by providing functionality to lock down query plans, enabling organizations to promote stable query plans across hardware server replacements, server upgrades, and production deployments.

Data Compression

Enable data to be stored more effectively, and reduce the storage requirements for your data. Data compression also provides significant performance improvements for large I/O bound workloads, like data warehousing.

Hot Add CPU

Dynamically scale a database on demand by allowing CPU resources to be added to SQL Server 2008 on supported hardware platforms without forcing any downtime on applications. Note that SQL Server already supports the ability to add memory resources online.

Policy-Based Management

Policy-Based Management is a policy-based system for managing one or more instances of SQL Server 2008. Use this with SQL Server Management Studio to create policies that manage entities on the server, such as the instance of SQL Server, databases, and other SQL Server objects.

Streamlined Installation

SQL Server 2008 introduces significant improvements to the service life cycle for SQL Server through the re-engineering of the installation, setup, and configuration architecture. These improvements separate the installation of the physical bits on the hardware from the configuration of the SQL Server software, enabling organizations and software partners to provide recommended installation configurations.

Page 38: All Interview Questions

Performance Data Collection

Performance tuning and troubleshooting are time-consuming tasks for the administrator. To provide actionable performance insights to administrators, SQL Server 2008 includes more extensive performance data collection, a new centralized data repository for storing performance data, and new tools for reporting and monitoring.

Language Integrated Query (LINQ)

Enable developers to issue queries against data, using a managed programming language, such as C# or VB.NET, instead of SQL statements. Enable seamless, strongly typed, set-oriented queries written in .NET languages to run against ADO.NET (LINQ to SQL), ADO.NET DataSets (LINQ to DataSets), the ADO.NET Entity Framework (LINQ to Entities), and to the Entity Data Service Mapping provider. Use the new LINQ to SQL provider that enables developers to use LINQ directly on SQL Server 2008 tables and columns.

ADO.NET Data Services

The Object Services layer of ADO.NET enables the materialization, change tracking, and persistence of data as CLR objects. Developers using the ADO.NET framework can program against a database, using CLR objects that are managed by ADO.NET. SQL Server 2008 introduces more efficient, optimized support that improves performance and simplifies development.

DATE/TIME

SQL Server 2008 introduces new date and time data types:

o DATE—A date-only typeo TIME—A time-only type

o DATETIMEOFFSET—A time-zone-aware datetime type

o DATETIME2—A datetime type with larger fractional seconds and year range than the existing DATETIME type

The new data types enable applications to have separate data and time types while providing large data ranges or user defined precision for time values.

HIERARCHY ID

Enable database applications to model tree structures in a more efficient way than currently possible. New system type HierarchyId can store values that represent nodes in a hierarchy tree. This new type will be implemented as a CLR UDT, and will expose several efficient and useful built-in methods for creating and operating on hierarchy nodes with a flexible programming model.

FILESTREAM Data

Allow large binary data to be stored directly in an NTFS file system, while preserving an integral part of the database and maintaining transactional consistency. Enable the scale-out of large binary data traditionally managed by the database to be stored outside the database on more cost-effective storage without compromise.

Integrated Full Text Search

Page 39: All Interview Questions

Integrated Full Text Search makes the transition between Text Search and relational data seamless, while enabling users to use the Text Indexes to perform high-speed text searches on large text columns.

Sparse Columns

NULL data consumes no physical space, providing a highly efficient way of managing empty data in a database. For example, Sparse Columns allows object models that typically have numerous null values to be stored in a SQL Server 2005 database without experiencing large space costs.

Large User-Defined Types

SQL Server 2008 eliminates the 8-KB limit for User-Defined Types (UDTs), allowing users to dramatically expand the size of their UDTs.

Spatial Data Types

Build spatial capabilities into your applications by using the support for spatial data.

o Implement Round Earth solutions with the geography data type. Use latitude and longitude coordinates to define areas on the Earth's surface.

o Implement Flat Earth solutions with the geometry data type. Store polygons, points, and lines that are associated with projected planar surfaces and naturally planar data, such as interior spaces.

Backup Compression

Keeping disk-based backups online is expensive and time-consuming. With SQL Server 2008 backup compression, less storage is required to keep backups online, and backups run significantly faster since less disk I/O is required.

Partitioned Table Parallelism

Partitions enable organizations to manage large growing tables more effectively by transparently breaking them into manageable blocks of data. SQL Server 2008 builds on the advances of partitioning in SQL Server 2005 by improving the performance on large partitioned tables.

Star Join Query Optimizations

SQL Server 2008 provides improved query performance for common data warehouse scenarios. Star Join Query optimizations reduce query response time by recognizing data warehouse join patterns.

Grouping Sets

Grouping Sets is an extension to the GROUP BY clause that lets users define multiple groupings in the same query. Grouping Sets produces a single result set that is equivalent to a UNION ALL of differently grouped rows, making aggregation querying and reporting easier and faster.

Change Data Capture

With Change Data Capture, changes are captured and placed in change tables. It captures complete content of changes, maintains cross-table consistency, and even works across

Page 40: All Interview Questions

schema changes. This enables organizations to integrate the latest information into the data warehouse.

MERGE SQL Statement

With the introduction of the MERGE SQL Statement, developers can more effectively handle common data warehousing scenarios, like checking whether a row exists, and then executing an insert or update.

SQL Server Integration Services (SSIS) Pipeline Improvements

Data Integration packages can now scale more effectively, making use of available resources and managing the largest enterprise-scale workloads. The new design improves the scalability of runtime into multiple processors.

SQL Server Integration Services (SSIS) Persistent Lookups

The need to perform lookups is one of the most common ETL operations. This is especially prevalent in data warehousing, where fact records need to use lookups to transform business keys to their corresponding surrogates. SSIS increases the performance of lookups to support the largest tables.

Analysis Scale and Performance

SQL Server 2008 drives broader analysis with enhanced analytical capabilities and with more complex computations and aggregations. New cube design tools help users streamline the development of the analysis infrastructure enabling them to build solutions for optimized performance.

Block Computations

Block Computations provides a significant improvement in processing performance enabling users to increase the depth of their hierarchies and complexity of the computations.

Writeback

New MOLAP enabled writeback capabilities in SQL Server 2008 Analysis Services removes the need to query ROLAP partitions. This provides users with enhanced writeback scenarios from within analytical applications without sacrificing the traditional OLAP performance.

Enterprise Reporting Engine

Reports can easily be delivered throughout the organization, both internally and externally, with simplified deployment and configuration. This enables users to easily create and share reports of any size and complexity.

Internet Report Deployment

Customers and suppliers can effortlessly be reached by deploying reports over the Internet.

Manage Reporting Infrastructure

Increase supportability and the ability to control server behaviour with memory management, infrastructure consolidation, and easier configuration through a centralized store and API for all configuration settings.

Page 41: All Interview Questions

Report Builder Enhancements

Easily build ad-hoc and author reports with any structure through Report Designer.

Forms Authentication Support

Support for Forms authentication enables users to choose between Windows and Forms authentication.

Report Server Application Embedding

Report Server application embedding enables the URLs in reports and subscriptions to point back to front-end applications.

Microsoft Office Integration

SQL Server 2008 provides new Word rendering that enables users to consume reports directly from within Microsoft Office Word. In addition, the existing Excel renderer has been greatly enhanced to accommodate the support of features, like nested data regions, sub-reports, as well as merged cell improvements. This lets users maintain layout fidelity and improves the overall consumption of reports from Microsoft Office applications.

Predictive Analysis

SQL Server Analysis Services continues to deliver advanced data mining technologies. Better Time Series support extends forecasting capabilities. Enhanced Mining Structures deliver more flexibility to perform focused analysis through filtering as well as to deliver complete information in reports beyond the scope of the mining model. New cross-validation enables confirmation of both accuracy and stability for results that you can trust. Furthermore, the new features delivered with SQL Server 2008 Data Mining Add-ins for Office 2007 empower every user in the organization with even more actionable insight at the desktop.

How many classes can a single .NET DLL contain ? It can contain many classes.

True or False: To test a Web service you must create a windows application or Web application to consume this service ? False, the webservice comes with a test page and it provides HTTP-GET method to test.

Which control would you use if you needed to make sure the values in two different controls matched ? CompareValidator Control

Which property on a Combo Box do you set with a column name, prior to setting the DataSource, to display data in the combo box ? DataTextField property

What does WSDL stand for ? (Web Services Description Language)

Page 42: All Interview Questions

True or False: A Web service can only be written in .NET ? False

What tag do you use to add a hyperlink column to the DataGrid ?

What tags do you need to add within the asp:datagrid tags to bind columns manually ? Set AutoGenerateColumns Property to false on the datagrid tag

What base class do all Web Forms inherit from ? The Page class.

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 ? You must set the DataSource property and call the DataBind method.

Which template must you provide, in order to display data in a Repeater control ? ItemTemplate

If I’m developing an application that must accommodate multiple security levels though secure login and my ASP.NET web application is spanned across three web-servers (using round-robin load balancing) what would be the best approach to maintain login-in state for the users ? Maintain the login state security through a database.

What does the “EnableViewState” property do? Why would I want it on or off ? It enables the viewstate on the page. It allows the page to save the users input on a form.

What data type does the RangeValidator control support ? Integer,String and Date.

Suppose you want a certain ASP.NET function executed on MouseOver overa certain button. Where do you add an event handler ? It’s the Attributesproperty, the Add function inside that property. So btnSubmit.Attributes.Add(”onMouseOver”,”someClientCode();”)

What’s a bubbled event ? When you have a complex control, like DataGrid, writing an event processing routine for each object (cell, button, row, etc.) is quite tedious. The controls can bubble up their eventhandlers, allowing the main DataGrid event handler to take care of its constituents.

What’s the difference between Codebehind=”MyCode.aspx.cs” andSrc=”MyCode.aspx.cs” ?

Page 43: All Interview Questions

CodeBehind is relevant to Visual Studio.NET only.

Where do you store the information about the user’s locale ? System.Web.UI.Page.Culture

Where does the Web page belong in the .NET Framework class hierarchy ? System.Web.UI.Page

What’s the difference between Response.Write() andResponse.Output.Write() ? The latter one allows you to write formattedoutput.

Describe the role of inetinfo.exe, aspnet_isapi.dll andaspnet_wp.exe in the page loading process ? inetinfo.exe is theMicrosoft 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 tothe actual worker process aspnet_wp.exe.

What is method to get XML and schema from Dataset ? getXML () and get Schema ()

Differences between dataset.clone and dataset.copy ? Clone - Copies the structure of the DataSet, including all DataTable schemas, relations, and constraints. Does not copy any data.Copy - Copies both the structure and data for this DataSet.

How to check if a datareader is closed or opened ? IsClosed()

In how many ways we can retrieve table records count? How to find the count of records in a dataset ? foreach(DataTable thisTable in myDataSet.Tables){// For each row, print the values of each column.foreach(DataRow myRow in thisTable.Rows){

What happens when we issue Dataset.ReadXml command ? Reads XML schema and data into the DataSet.

Explain different methods and Properties of DataReader which you have used in your project ?

Page 44: All Interview Questions

ReadGetStringGetInt32while (myReader.Read())Console.WriteLine(” {0} {1}”, myReader.GetInt32(0), myReader.GetString(1));myReader.Close();

Difference between DataReader and DataAdapter / DataSet and DataAdapter? 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.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.SqlDataReader myReader = myCommand.ExecuteReader();You use the Read method of the DataReader object to obtain a row from the results of the query.while (myReader.Read())Console.WriteLine(” {0} {1}”, myReader.GetInt32(0), myReader.GetString(1));myReader.Close();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.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.

Page 45: All Interview Questions

What are the different namespaces used in the project to connect the database? What data providers available in .net to connect to database ? •    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.•    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.•    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.•    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.

Difference between OLEDB Provider and SqlClient ? SQLClient .NET classes are highly optimized for the .net / sqlserver combination and achieve optimal results. The SqlClient data provider is fast. It’s faster than the Oracle provider, and faster than accessing database via the OleDb layer. It’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.

What are relation objects in dataset and how & where to use them ? 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.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.custDS.Relations.Add(”CustOrders”,custDS.Tables[”Customers”].Columns[”CustID”],custDS.Tables[”Orders”].Columns[”CustID”]);

OR

Page 46: All Interview Questions

private void CreateRelation(){// Get the DataColumn objects from two DataTable objects in a DataSet.DataColumn parentCol;DataColumn childCol;// Code to get the DataSet not shown here.parentCol = DataSet1.Tables[”Customers”].Columns[”CustID”];childCol = DataSet1.Tables[”Orders”].Columns[”CustID”];// Create DataRelation.DataRelation relCustOrder;relCustOrder = new DataRelation(”CustomersOrders”, parentCol, childCol);// Add the relation to the DataSet.DataSet1.Relations.Add(relCustOrder);}

How would u connect to database using .NET ? SqlConnection nwindConn = new SqlConnection(”Data Source=localhost; Integrated Security=SSPI;” +“Initial Catalog=northwind”);nwindConn.Open();

Advantage of ADO.Net ? o    ADO.NET Does Not Depend On Continuously Live Connectionso    Database Interactions Are Performed Using Data Commandso    Data Can Be Cached in Datasetso    Datasets Are Independent of Data Sourceso    Data Is Persisted as XMLo    Schemas Define Data Structures

What is the different between ASP.NET and VB.NET? ASP.Net is an “environment”, and VB.Net is a programming language. You can write ASP.Net pages (called “Web Forms” by Microsoft) using VB.Net (or C#, or J# or Managed C++ or any one of a number of .Net compatible languages).

Confusingly, there is an IDE that Microsoft markets called VB.Net, which allows you to write and compile programs (WinForms, WebForms, class libraries etc) written in the language VB.Net

Page 47: All Interview Questions

ASP.Net is simple a library that makes it easy for you to create web applications that run against the .NET runtime (similar to the java runtime).

VB.Net is a language that compiles against the common language runtime, like C#. Any .NET compliant language can use the asp.net libraries to create web applications.

Note : Actually there is not an IDE called VB.Net.  Microsoft’s IDE is called Visual Studio.Net which can be used to manage VB.Net, C#, Eiffle, Fortran, and other languages.

How can we create custom controls in ASP.NET? Custom Controls can be created in either of the following 3 methods.

1. Creating as a composite control : This method uses and combines the existing controls to give a custom functionality which can be used across different projects by adding to the control library. This can provide for event bubbling from child controls to the Parent container, custom event handling and properties. The CreateChildControls function of the Control class should be overridden for creating this custom control. This can also support design time rendering of the control.

2. Deriving from an existing control : This method of creating a custom control derives from an existing ASP .Net control and customizing the properties that we need. This also can support custom event handling, properties etc.,

3. Creating a control from Scratch : This method is the one which needs maximum programming. This method needs even the HTML code for the custom controls to be written by the programmer. This may also need one to implement the IPostBackDataHandler and IPostBackEventHandler interfaces. A detailed explanation with example for this is available at Rendering Custom Controls Sample in MSDN.

How many types of validation controls are provided by ASP.NET ? RequiredField Validator Control,Range Validator Control, RegularExpression Validator Control,Custom Validator Control and Validation Summary Control are provided by ASP.NET.

Can you explain what is “AutoPostBack” feature in ASP.NET ? AutoPostBack is built into the form-based server controls, and when enabled, automatically posts the page back to the server whenever the value of the control in question is changed.

How can you enable automatic paging in DataGrid ? Using the Built-In Paging Controls

Page 48: All Interview Questions

To use default paging, you set properties to enable paging, set the page size, and specify the style of the paging controls. Paging controls are LinkButton controls. You can choose from these types: Next and previous buttons. The button captions can be any text you want. Page numbers, which allow users to jump to a specific page. You can specify how many numbers are displayed; if there are more pages, an ellipsis ( … ) is displayed next to the numbers. You must also create an event-handling method that responds when users click a navigation control.

To use the built-in paging controlsSet the control’s AllowPaging property to true. Set the PageSize property to the number of items to display per page.

To set the appearance of the paging buttons, include a element into the page as a child of the DataGrid control. For syntax, see DataGrid Control Syntax. Create a handler for the grid’s PageIndexChanged event to respond to a paging request. The DataGridPageChangedEventsArgs enumeration contains the NewPageIndex property, which is the page the user would like to browse to. Set the grid’s CurrentPageIndex property to e.NewPageIndex, then rebind the data.

What is the difference between login controls and Forms authentication? Login controls are an easy way to implement Forms authentication without having to write any code. For example, the Login control performs the same functions you would normally perform when using the FormsAuthentication class—prompt for user credentials, validate them, and issue the authentication ticket—but with all the functionality wrapped in a control that you can just drag from the Toolbox in Visual Studio. Under the covers, the login control uses the FormsAuthentication class (for example, to issue the authentication ticket) and ASP.NET membership (to validate the user credentials). Naturally, you can still use Forms authentication yourself, and applications you have that currently use it will continue to run.

What is Tracing in ASP.NET ? ASP.NET introduces new functionality that allows you to write debug statements, directly in your code, without having to remove them from your application when it is deployed to production servers. Called tracing, this feature allows you to write variables or structures in a page, assert whether a condition is met, or simply trace through the execution path of your page or application.

How do we enable tracing ? Instead of enabling tracing for individual pages, you can enable it for your entire application. In that case, every page in your application displays trace information. Application tracing is useful when you are developing an application because you can easily enable it and disable it

Page 49: All Interview Questions

without editing individual pages. When your application is complete, you can turn off tracing for all pages at once.When you enable tracing for an application, ASP.NET collects trace information for each request to the application, up to the maximum number of requests you specify. The default number of requests is 10. You can view trace information with the trace viewer.By default, when the trace viewer reaches its request limit, the application stops storing trace requests. However, you can configure application-level tracing to always store the most recent tracing data, discarding the oldest data when the maximum number of requests is reached.To Enable Tracing for an application

1.Open your Web site’s Web.config file. If no Web.config file exists, create a new file in the root folder and copy the following into it:

 

 

 

2.Add a trace element as a child of the system.web element.

3.In the trace element, set the enabled attribute to true.

4.If you want trace information to appear at the end of the page that it is associated with, set the trace element’s pageOutput attribute to true. If you want tracing information to be displayed only in the trace viewer, set the pageOutput attribute to false.For example, the following application trace configuration collects trace information for up to 40 requests and allows browsers on computers other than the server of origin to display the trace viewer. Trace information is not displayed in individual pages.

What exactly happens when ASPX page is requested from Browser? At its core, the ASP.NET execution engine compiles the page into a class, which derives from the code behind class (which in turn derives directly or indirectly from the Page class). Then it injects the newly created class into the execution environment, instantiates it, and executes it. ASP.NET, on the other hand, can accept code in any language that is compatible with the .NET framework, because it’s compiled down natively just like other code.

How do you deploy an ASP.NET application? You can deploy an ASP.NET Web application using any one of the following three deployment options.1.XCOPY Deployment

Page 50: All Interview Questions

2.Using the Copy Project option in VS .NET

3.Deployment using VS.NET installer

ASP.NET Configuration. ASP.NET Configuration

The ASP.NET configuration system features an extensible infrastructure that enables you to define configuration settings at the time your ASP.NET applications are first deployed so that you can add or revise configuration settings at any time with minimal impact on operational Web applications and servers.

The ASP.NET configuration system provides the following benefits:

* Configuration information is stored in XML-based text files. You can use any standard text editor or XML parser to create and edit ASP.NET configuration files.

* Multiple configuration files, all named Web.config, can appear in multiple directories on an ASP.NET Web application server. Each Web.config file applies configuration settings to its own directory and all child directories below it. Configuration files in child directories can supply configuration information in addition to that inherited from parent directories, and the child directory configuration settings can override or modify settings defined in parent directories. The root configuration file named systemrootMicrosoft.NETFrameworkversionNumberCONFIGMachine.config provides ASP.NET configuration settings for the entire Web server.

* At run time, ASP.NET uses the configuration information provided by the Web.config files in a hierarchical virtual directory structure to compute a collection of configuration settings for each unique URL resource. The resulting configuration settings are then cached for all subsequent requests to a resource. Note that inheritance is defined by the incoming request path (the URL), not the file system paths to the resources on disk (the physical paths).

* ASP.NET detects changes to configuration files and automatically applies new configuration settings to Web resources affected by the changes. The server does not have to be rebooted for the changes to take effect. Hierarchical configuration settings are automatically recalculated and recached whenever a configuration file in the hierarchy is changed. The

section is an exception. * The ASP.NET configuration system is extensible. You can define new configuration parameters and write configuration section handlers to process them.

Page 51: All Interview Questions

* ASP.NET help protect configuration files from outside access by configuring Internet Information Services (IIS) to prevent direct browser access to configuration files. HTTP access error 403 (forbidden) is returned to any browser attempting to request a configuration file directly.

What can be stored in Web.config file? There are number of important settings that can be stored in the configuration file. Here are some of the most frequently used configurations, stored conveniently inside Web.config file..

1. Database connections2. Session States3. Error Handling4. Security

Difference between Web.config and machine.config. web.config:Web.config file, as it sounds like is a configuration file for the Asp .net web application. An Asp .net application has one web.config file which keeps the configurations required for the corresponding application. Web.config file is written in XML with specific tags having specific meanings.

machine.configAs web.config file is used to configure one asp .net web application, same way Machine.config file is used to configure the application according to a particular machine. That is, configuration done in machine.config file is affected on any application that runs on a particular machine. Usually, this file is not altered and only web.config is used which configuring applications.

Where we can use DLL made in C#.Net ? Supporting .Net, bcoz DLL made in C#.Net semicompiled version. Its not a com object. It is used only in .Net Framework.As it is to be compiled at runtime to byte code.

If A.equals(B) is true then A.getHashcode & B.getHashCode must always return same hash code. The answer is False because it is given that A.equals(B) returns true i.e. objects are equal and now its hashCode is asked which is always independent of the fact that whether objects are equal or not. So, GetHashCode for both of the objects returns different value.

To Configure .Net for JIT activation what do you do?

Page 52: All Interview Questions

Actually JIT activation is required for COM+ components which can be done by setting JustInTimeActivation attribute to true (choice A). For .net applications / components JIT comes in by default.

How do you import Activex component in to .NET? An application called AXImp.exe shipped with .Net SDK is used.This application does something similar as Tlbimp.exe does for non graphical COM components.It creates a wrapper component that contains the type information that the .Net runtime can understand.

What is the use of fixed statement? The fixed statement sets a pointer to a managed variable and “pins” that variable during the execution of statement.Without fixed, pointers to managed variables would be of little use since garbage collection could relocate the variables unpredictably. (In fact, the C# compiler will not allow you to set a pointer to a managed variable except in a fixed statement.)Eg:

Class A { public int i; }A objA = new A; // A is a .net managed typefixed(int *pt = &objA.i) // use fixed while using pointers with managed// variables{*pt=45; // in this block use the pointer the way u want}

What is the order of destructors called in a polymorphism hierarchy? Destructors are called in reverse order of constructors. First destructor of most derived class is called followed by its parent’s destructor and so on till the topmost class in the hierarchy.You don’t have control over when the first destructor will be called, since it is determined by the garbage collector. Sometime after the object goes out of scope GC calls the destructor, then its parent’s destructor and so on.When a program terminates definitely all object’s destructors are called.

How can you sort the elements of the array in descending order? int[] arr = new int[3];arr[0] = 4;

Page 53: All Interview Questions

arr[1] = 1;arr[2] = 5;Array.Sort(arr);Array.Reverse(arr);

Is it possible to Override Private Virtual methods. No, First of all you cannot declare a method as ‘private virtual’.

What does the volatile modifier do? The system always reads the current value of a volatile object at the point it is requested, even if the previous instruction asked for a value from the same object. Also, the value of the object is written immediately on assignment.The volatile modifier is usually used for a field that is accessed by multiple threads without using the lock statement to serialize access. Using the volatile modifier ensures that one thread retrieves the most up-to-date value written by another thread.

Is it possible to debug the classes written in other .Net languages in a C# project. It is definitely possible to debug other .Net languages code in a C# project. As everyone knows .net can combine code written in several .net languages into one single assembly. Same is true with debugging.

How do you debug an ASP.NET Web application? Attach the aspnet_wp.exe process to the DbgClr debugger.

What debugging tools come with the .NET SDK? 1.   CorDBG – command-line debugger.  To use CorDbg, you must compile the original C# file using the /debug switch.2.   DbgCLR – graphic debugger.  Visual Studio .NET uses the DbgCLR.

What is the difference between structures and enumeration? Unlike classes, structs are value types and do not require heap allocation. A variable of a struct type directly contains the data of the struct, whereas a variable of a class type contains a reference to the data. They are derived from System.ValueType class.

Enum->An enum type is a distinct type that declares a set of named constants.They  are strongly typed constants. They are unique types that allow to declare symbolic names to integral values. Enums are value types, which means they contain their own value, can’t inherit or be inherited from and assignment copies the value of one enum to another.

Page 54: All Interview Questions

public enum Grade{A,B,C}

What is Value type and refernce type in .Net? Value Type : A variable of a value type always contains a value of that type. The assignment to a variable of a value type creates a copy of the assigned value, while the assignment to a variable of a reference type creates a copy of the reference but not of the referenced object.

The value types consist of two main categories:* Stuct Type* Enumeration Type

Reference Type :Variables of reference types, referred to as objects, store references to the actual data. This section introduces the following keywords used to declare reference types:* Class* Interface* Delegate

This section also introduces the following built-in reference types:* object* string

What are the types of assemblies? There are four types of assemblies in .NET:

Static assembliesThese are the .NET PE files that you create at compile time.Dynamic assembliesThese are PE-formatted, in-memory assemblies that you dynamically create at runtime using the classes in the System.Reflection.Emit namespace.

Private assemblies These are static assemblies used by a specific application.

Page 55: All Interview Questions

Public or shared assemblies These are static assemblies that must have a unique shared name and can be used by any application.

An application uses a private assembly by referring to the assembly using a static path or through an XML-based application configuration file. While the CLR doesn’t enforce versioning policies-checking whether the correct version is used-for private assemblies, it ensures that an application uses the correct shared assemblies with which the application was built. Thus, an application uses a specific shared assembly by referring to the specific shared assembly, and the CLR ensures that the correct version is loaded at runtime.In .NET, an assembly is the smallest unit to which you can associate a version number

What is manifest?

It is the metadata that describes the assemblies.

What distributed process frameworks outside .NET do you know? Distributed Computing Environment/Remote Procedure Calls (DEC/RPC), Microsoft Distributed Component Object Model  (DCOM), Common Object Request Broker Architecture (CORBA), and Java Remote Method Invocation (RMI).

How do you retrieve the customized properties of a .NET application from XML .config file? Initialize an instance of AppSettingsReader class. Call the GetValue method of AppSettingsReader class, passing in the name of the property and the type expected. Assign the result to the appropriate variable.

When would you use ErrorProvider control? ErrorProvider control is used in Windows Forms application. It is like Validation Control for ASP.NET pages. ErrorProvider control is used to provide validations in Windows forms and display user friendly messages to the user if the validation fails.  E.g. if we went to validate the textBox1 should be empty, then we can validate as below

1). You need to place the errorprovide control on the form

private void textBox1_Validating(object

sender,System.ComponentModel.CancelEventArgs e)

{

ValidateName();

}

private bool ValidateName()

Page 56: All Interview Questions

{

bool bStatus = true;

if (textBox1.Text == "")

{

errorProvider1.SetError (textBox1,"Please enter your Name");

bStatus = false;

}

else

errorProvider1.SetError (textBox1,"");

return bStatus;

}

it check the textBox1 is empty . If it is empty, then a message Please enter your name is displayed.

What is the difference between Debug.Write and Trace.Write?

The Debug.Write call won’t be compiled when the DEBUGsymbol is not defined (when doing a release build). Trace.Write calls will be compiled. Debug.Write is for information you want only in debug builds, Trace.Write is for when you want it in release build as well.

What are different transaction options available for services components? There are 5 transactions types that can be used with COM+. Whenever an object is registered with COM+ it has to abide either to these 5 transaction types.

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

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

Supported: - Components with transaction type supported will be a part of the transaction if the calling component has an active transaction.

Page 57: All Interview Questions

If the calling component is not transaction enabled this component will not start a new transaction.

Required: - Components with this attribute require a transaction i.e. either the calling should have a transaction in place else this component will start a new transaction.

Required New: - Components enabled with this transaction type always require a new transaction. Components with required new transaction type instantiate a new transaction for themselves every time.

What does it meant to say “the canonical” form of XML? The purpose of Canonical XML is to define a standard format for an XML document. Canonical XML is a very strict XML syntax, which lets documents in canonical XML be compared directly.Using this strict syntax makes it easier to see whether two XML documents are the same. For example, a section of text in one document might read Black & White, whereas the same section of text might read Black & White in another document, and even in another. If you compare those three documents byte by byte, they’ll be different. But if you write them all in canonical XML, which specifies every aspect of the syntax you can use, these three documents would all have the same version of this text (which would be Black & White) and could be compared without problem. This Comparison is especially critical when xml documents are digitally signed. The digital signal may be interpreted in different way and the document may be rejected.

What are the mobile devices supported by .net platform? The Microsoft .NET Compact Framework is designed to run on mobile devices such as mobile phones, Personal Digital Assistants (PDAs), and embedded devices. The easiest way to develop and test a Smart Device Application is to use an emulator.These devices are divided into two main divisions:1) Those that are directly supported by .NET (Pocket PCs, i-Mode phones, and WAP devices)2) Those that are not (Palm OS and J2ME-powered devices).

What is a Windows Service and how does its lifecycle differ from a “standard” EXE? Windows service is a application that runs in the background. It is equivalent to a NT service.The executable created is not a Windows application, and hence you can’t just click and run it . it needs to be installed as a service, VB.Net has a facility where we can add an installer to our program and then use a utility to install the service. Where as this is not the case with standard exe

What is the difference between repeater over datalist and datagrid?

Page 58: All Interview Questions

The Repeater class is not derived from the WebControl class, like the DataGrid and DataList. Therefore, the Repeater lacks the stylistic properties common to both the DataGrid and DataList. What this boils down to is that if you want to format the data displayed in the Repeater, you must do so in the HTML markup. The Repeater control provides the maximum amount of flexibility over the HTML produced. Whereas the DataGrid wraps the DataSource contents in an HTML < table >, and the DataList wraps the contents in either an HTML < table > or < span > tags (depending on the DataList’s RepeatLayout property), the Repeater adds absolutely no HTML content other than what you explicitly specify in the templates. While using Repeater control, If we wanted to display the employee names in a bold font we’d have to alter the “ItemTemplate” to include an HTML bold tag, Whereas with the DataGrid or DataList, we could have made the text appear in a bold font by setting the control’s ItemStyle-Font-Bold property to True. The Repeater’s lack of stylistic properties can drastically add to the development time metric. For example, imagine that you decide to use the Repeater to display data that needs to be bold, centered, and displayed in a particular font-face with a particular background color. While all this can be specified using a few HTML tags, these tags will quickly clutter the Repeater’s templates. Such clutter makes it much harder to change the look at a later date. Along with its increased development time, the Repeater also lacks any built-in functionality to assist in supporting paging, editing, or editing of data. Due to this lack of feature-support, the Repeater scores poorly on the usability scale.However, The Repeater’s performance is slightly better than that of the DataList’s, and is more noticeably better than that of the DataGrid’s. Following figure shows the number of requests per second the Repeater could handle versus the DataGrid and DataList

What is a PostBack? The process in which a Web page sends data back to the same page on the server.

Is it possible to prevent a browser from caching an ASPX page? Just call SetNoStore on the HttpCachePolicy object exposed through the Response object’s Cache property, as demonstrated here:

SetNoStore works by returning a Cache-Control: private, no-store header in the HTTP response. In this example, it prevents caching of a Web page that shows the current time.

Page 59: All Interview Questions

What are VSDISCO files? VSDISCO files are DISCO files that support dynamic discovery of Web services. If you place the following VSDISCO file in a directory on your Web server, for example, it returns   references to all ASMX and DISCO files in the host directory and any subdirectories not noted in elements:

<DYNAMICDISCOVERYxmlns="urn:schemas-dynamicdiscovery:disco.2000-03-17">

 

Name two properties common in every validation control?

ControlToValidate property and Text property.

What namespace does the Web page belong in the .NET Framework class hierarchy?

System.Web.UI.Page

Are the actual permissions for the application defined at run-time or compile-time? The CLR computes actual permissions at runtime based on code group membership and the calling chain of the code.

What is the difference between authentication and authorization? Authentication happens first. You verify user’s identity based on credentials. Authorization is making sure the user only gets access to the resources he has credentials for.

What is a code group? A code group is a set of assemblies that share a security context.

How can C# app request minimum permissions? Using System.Security.Permissions;[assembly:FileDialogPermissionAttribute(SecurityAction.RequestMinimum, Unrestricted=true)].

How can you work with permissions from your .NET application?

Page 60: All Interview Questions

You can request permission to do something and you can demand certain permissions from other apps. You can also refuse permissions so that your app is not inadvertently used to destroy some data.

What’s the difference between code-based security and role-based security? Which one is better? Code security is the approach of using permissions and permission sets for a given code to run. The admin, for example, can disable running executables off the Internet or restrict access to corporate database to only few applications. Role-based security most of the time involves the code running with the privileges of the current user. This way the code cannot supposedly do more harm than mess up a single user account. There’s no better, or 100% thumbs-up approach, depending on the nature of deployment, both code-based and role-based security could be implemented to an extent.

How do you display an editable drop-down list? Displaying a drop-down list requires a template column in the grid. Typically, the ItemTemplate contains a control such as a data-bound Label control to show the current value of a field in the record. You then add a drop-down list to the EditItemTemplate. In Visual Studio, you can add a template column in the Property builder for the grid, and then use standard template editing to remove the default TextBox control from the EditItemTemplate and drag a DropDownList control into it instead. Alternatively, you can add the template column in HTML view. After you have created the template column with the drop-down list in it, there are two tasks. The first is to populate the list. The second is to preselect the appropriate item in the list — for example, if a book’s genre is set to “fiction,” when the drop-down list displays, you often want “fiction” to be preselected.

How to manage pagination in a page? Using pagination option in DataGrid control. We have to set the number of records for a page, then it takes care of pagination by itself.

Can the validation be done in the server side? Client side validation is done by default. Server side validation is also possible. We can switch off the client side and server side can be done.

How do you validate the controls in an ASP .NET page? We can Validate the controls in an ASP.NET page by using special validation controls that are meant for this. We have Range Validator, Email Validator.

What is smart navigation?

Page 61: All Interview Questions

The cursor position is maintained when the page gets refreshed due to the server side validation and the page gets refreshed.

How is .NET able to support multiple languages? A language should comply with the Common Language Runtime standard to become a .NET language. In .NET, code is compiled to Microsoft Intermediate Language (MSIL for short). This is called as Managed Code. This Managed code is run in .NET environment. So after compilation to this IL the language is not a barrier. A code can call or use a function written in another language.

What is the difference between Java and .NET garbage collectors? Sun left the implementation of a specific garbage collector up to the JRE developer, so their performance varies widely, depending on whose JRE you’re using. Microsoft standardized on their garbage collection.

What is the CLI? Is it the same as the CLR? The CLI (Common Language Infrastructure) is the definiton of the fundamentals of the .NET framework - the Common Type System (CTS), metadata, the Virtual Execution Environment (VES) and its use of intermediate language (IL), and the support of multiple programming languages via the Common Language Specification (CLS). The CLI is documented through ECMA

The CLR (Common Language Runtime) is Microsoft’s primary implementation of the CLI. Microsoft also have a shared source implementation known as ROTOR, for educational purposes, as well as the .NET Compact Framework for mobile devices. Non-Microsoft CLI implementations include Mono and DotGNU Portable.NET.

What is an application domain? An AppDomain can be thought of as a lightweight process. Multiple AppDomains can exist inside a Win32 process. The primary purpose of the AppDomain is to isolate applications from each other, and so it is particularly useful in hosting scenarios such as ASP.NET. An AppDomain can be destroyed by the host without affecting other AppDomains in the process.

Win32 processes provide isolation by having distinct memory address spaces. This is effective, but expensive. 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’s memory.

Page 62: All Interview Questions

One non-obvious use of AppDomains is for unloading types. Currently the only way to unload a .NET type is to destroy the AppDomain it is loaded into. This is particularly useful if you create and destroy types on-the-fly via reflection.

Does .NET support one-way Web service operations? Does Microsoft SOAP Toolkit support one-way Web service operations? Yes, .NET framework does support one-way messages. To set a void method as one-way operation, set the OneWay property to true on SoapDocumentMethodAttribute or on SoapRpcMethodAttribute attribute. In such cases, the Web service client is intending to just send some notification to the server and not expect any response. The server in such cases returns 202 Accepted HTTP response to the client. And there will be no output message in the WSDL file for such methods. The support for one-way Web service operations was also added in the latest SOAP Toolkit 3.0 release.

Does .NET support validating XML documents against DTDs? Yes, in addition to XDR and XSD schema validation, .NET continues to support the DTD to validate the XML documents. The System.Xml namespace contains a class named XmlValidatingReader that can be used to validate the XML documents.

What is an .ASP file? It is a Text File that contains the combination of the following:• Text• HTML tags• Script Commands

Where would you use an iHTTPModule, and what are the limitations of anyapproach you might take in implementing one? One of ASP.NET’s most useful features is the extensibility of the HTTP pipeline, the path that data takes between client and server. You can use them to extend your ASP.NET applications by adding pre- and post-processing to each HTTP request coming into your application. For example, if you wanted custom authentication facilities for your application, the best technique would be to intercept the request when it comes in and process the request in a custom HTTP module.

Page 63: All Interview Questions