• +91 9723535972
  • info@interviewmaterial.com

DotNet Interview Questions and Answers

DotNet Interview Questions and Answers

Question - 61 : - What’s Singleton activation mode?

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

Question - 62 : - How do you define the lease of the object?

Answer - 62 : - By implementing ILease interface when writing the class code.

Question - 63 : - Can you configure a .NET Remoting object via XML file?

Answer - 63 : - Yes, via machine.config and application level .config file (or web.config in ASP.NET). Application-level XML settings take precedence over machine.config. How can you automatically generate interface for the remotable object in .NET with Microsoft tools? Use the Soapsuds tool.

Question - 64 : - What is Delegation?

Answer - 64 : - A delegate acts like a strongly type function pointer. Delegates can invoke the methods that they reference without making explicit calls to those methods. Delegate is an entity that is entrusted with the task of representation, assign or passing on information. In code sense, it means a Delegate is entrusted with a Method to report information back to it when a certain task (which the Method expects) is accomplished outside the Method's class.

Question - 65 : - What is "Microsoft Intermediate Language" (MSIL)?

Answer - 65 : - A .NET programming language (C#, VB.NET, J# etc.) does not compile into executable code; instead it compiles into an intermediate code called Microsoft Intermediate Language (MSIL). As a programmer one need not worry about the syntax of MSIL - since our source code in automatically converted to MSIL. The MSIL code is then send to the CLR (Common Language Runtime) that converts the code to machine language, which is, then run on the host machine. MSIL is similar to Java Byte code. MSIL is the CPU-independent instruction set into which .NET Framework programs are compiled. It contains instructions for loading, storing, initializing, and calling methods on objects. Combined with metadata and the common type system, MSIL allows for true cross- language integration Prior to execution, MSIL is converted to machine code. It is not interpreted.

Question - 66 : - Differences between Datagrid, Datalist and Repeater?

Answer - 66 : - 1. Datagrid has paging while Datalist doesnt. 2. Datalist has a property called repeat. Direction = vertical/horizontal. (This is of great help in designing layouts). This is not there in Datagrid. 3. A repeater is used when more intimate control over html generation is required. 4. When only checkboxes/radiobuttons are repeatedly served then a checkboxlist or radiobuttonlist are used as they involve fewer overheads than a Datagrid. The Repeater repeats a chunk of HTML you write, it has the least functionality of the three. DataList is the next step up from a Repeater; accept you have very little control over the HTML that the control renders. DataList is the first of the three controls that allow you Repeat-Columns horizontally or vertically. Finally, the DataGrid is the motherload. However, instead of working on a row-by-row basis, you’re working on a column-by-column basis. DataGrid caters to sorting and has basic paging for your disposal. Again you have little contro, over the HTML. NOTE: DataList and DataGrid both render as HTML tables by default. Out of the 3 controls, I use the Repeater the most due to its flexibility w/ HTML. Creating a Pagination scheme isn't that hard, so I rarely if ever use a DataGrid. Occasionally I like using a DataList because it allows me to easily list out my records in rows of three for instance. I am constantly writing the drawing procedures with System.Drawing.Graphics, but having to use the try and dispose blocks is too time-consuming with Graphics objects. Can I automate this? Yes, the code System.Drawing.Graphics canvas = new System.Drawing.Graphics(); try { //some code } finally canvas.Dispose(); is functionally equivalent to using (System.Drawing.Graphics canvas = new System.Drawing.Graphics()) { //some code } //canvas.Dispose() gets called automatically

Question - 67 : - What’s SingleCall activation mode used for?

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

Question - 68 : - How can you automatically generate interface for the remotable object in .NET with Microsoft tools?

Answer - 68 : - Use the Soapsuds tool.

Question - 69 : - How do you trigger the Paint event in System.Drawing?

Answer - 69 : - Invalidate the current form, the OS will take care of repainting. The Update method forces the repaint. With these events, why wouldn’t Microsoft combine Invalidate and Paint, so that you wouldn’t have to tell it to repaint, and then to force it to repaint? Painting is the slowest thing the OS does, so usually telling it to repaint, but not forcing it allows for the process to take place in the background.

Question - 70 : - How can you assign an RGB color to a System.Drawing.Color object?

Answer - 70 : - Call the static method FromArgb of this class and pass it the RGB values.


NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners