Dot Net

  Home  Microsoft .Net Technologies  Dot Net


“Learn Dot Net with hundreds of Dot Net Interview Questions and Answers”



116 Dot Net Questions And Answers

82⟩ What is Delegation in .NET?

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.

 184 views

83⟩ What is "Microsoft Intermediate Language" (MSIL)?

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.

 204 views

84⟩ Differences between Datagrid, Datalist and Repeater in .NET?

1. Datagrid has paging while Datalist doesn't.

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

 212 views

85⟩ 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

 218 views

92⟩ What is the difference between VB 6 and VB.NET?

VB

1,Object-based Language

2,Doesnot support Threading

3,Not powerful Exception handling mechanism

4,Doesnot having support for the console based applications

5,Cannot use more than one version of com objects in vb application called DLL error

6,Doesnot support for the Disconnected data source.

VB.Net

1,Object-oriented Language

2,supports Threading

3,powerful Exception handling mechanism

4,having support for the console based applications

5,More than one version of dll is supported

6,supports the Disconnected data source by using Dataset class

 198 views

93⟩ What are the authentication methods in .NET?

There are 4 types of authentications.

1.WINDOWS AUTHENTICATION

2.FORMS AUTHENTICATION

3.PASSPORT AUTHENTICATION

4.NONE/CUSTOM AUTHENTICATION

The authentication option for the ASP.NET application is specified by using the tag in the Web.config file, as shown below:

other authentication options

1. WINDOWS AUTHENTICATION Schemes

I. Integrated Windows authentication

II. Basic and basic with SSL authentication

III. Digest authentication

IV. Client Certificate authentication

2. FORMS AUTHENTICATION

You, as a Web application developer, are supposed to develop the Web page and authenticate the user by checking the provided user ID and password against some user database

3.PASSPORT AUTHENTICATION

A centralized service provided by Microsoft, offers a single logon point for clients. Unauthenticated users are redirected to the Passport site

4 NONE/CUSTOM AUTHENTICATION:

If we don’t want ASP.NET to perform any authentication, we can set the authentication mode to “none”. The reason behind this decision could be: We don’t want to authenticate our users, and our Web site is open for all to use. We want to provide our own custom authentication

 196 views

94⟩ What is Serialization in .NET?

The serialization is the process of converting the objects into stream of bytes.

they or used for transport the objects(via remoting) and persist objects(via files and databases)

 211 views

95⟩ What’s the use of System.Diagnostics.Process class in .NET?

By using System.Diagnostics.Process class, we can provide access to the files which are presented in the local and remote system.

Example: System.Diagnostics.Process(”c:globalguidelineexample.txt”) — local file

System.Diagnostics.Process(”http://www.rendc.orgexample.txt”) — remote file

 195 views

96⟩ Difference Abstract class and Interface in .NET?

Abstract class: This class has abstract methods (no body). This class cannot be instantiated. One needs to provide the implementation of the methods by overriding them in the derived class. No Multiple Inheritance.

Interfaces: Interface class contains all abstract methods which are public by default. All of these methods must be implemented in the derived class. One can inherit from from more than one interface thus provides for Multiple Inheritance.

 222 views

97⟩ Explain re-clarification of object based in .NET?

VB6 DOES support polymorphism and interface inheritance. It also supports the “Implements” keyword. What is not supported in vb6 is implementation inheritance.

Also, from above, vb6 DOES “provides access to third-party controls like COM, DCOM ” That is not anything new in .NET.

 218 views

98⟩ How to achieve Polymorphism in VB.Net?

We can achieve polymarphism in .Net i.e Compile time polymarphism and Runtime polymarphism. Compiletime Polymarphism achieved by method overloading. Runtime polymarphism achieved by Early Binding or Late Binding. Provide the function pointer to the object at compile time called as Early Binding.

provide the function pointer to the object at runtime called as Late Binding

class emp having the method display()

class dept having the method display()

create objects as in the main function

// Early binding

dim obj as new emp

dim ob as new dept

obj.display()-to call the display method of emp class

ob.display-to call the display method of the dept class

// Late binding

create object in the main class as

object obj

obj=new emp

obj.display()-to call the display of emp class

obj=new dept

obj.display()-to call the display of dept class

 217 views

100⟩ What is namespaces in .NET?

It is a logical group of related classes and interfaces and that can be used by any language targeting the .net framework.

 218 views