DOT NET INTERVIEW QUESTIONS


 

 DOT NET INTERVIEW QUESTIONS

1.             Difference between Classic ASP and ASP.Net?
Answer:

§   ASP is Interpreted language based on scripting languages like Jscript or VBScript.

§   ASP has Mixed HTML and coding logic.

§   Limited development and debugging tools available.

§   Limited OOPS support.

§   Limited session and application state management.

§   Poor Error handling system.

§   No in-built support for XML.

§   No fully distributed data source support.
while

§   ASP.Net is supported by compiler and has compiled language support.

§   Separate code and design logic possible.

§   Variety of compilers and tools available including the Visual studio.Net.

§   Completely Object Oriented.

§   Complete session and application state management.

§   Full proof error handling possible.

§   Full XML Support for easy data exchange.

§   Fully distributed data source support.

2.             What’s the difference between Response.Write () and Response.Output.Write ()?
Answer: Response.Outout.Write allows us to write the formatted out put.

3.             Can you explain the difference between an ADO.NET Dataset and an ADO Recordset?
Answer:

§   A DataSet can represent an entire relational database in memory, complete with tables, relations, and views, A Recordset can not.

§    A DataSet is designed to work without any continues connection to the original data source; Recordset maintains continues connection with the original data source.

§   There’s no concept of cursor types in a DataSet, They are bulk loaded, while Recordset work with cursors and they are loaded on demand.

§   DataSets have no current record pointer, you can use For Each loops to move through the data. Recordsets have pointers to move through them.

§   You can store many edits in a DataSet, and write them to the original data source in a single operation. Recordset can have a single edit at a time.

§   Dataset can fetch source data from many tables at a time, for Recordset you can achieve the same only using the SQL joins.

4.             What is the difference between an abstract method & virtual method?
Answer: An Abstract method does not provide an implementation and forces overriding to the deriving class (unless the deriving class also an abstract class), where as the virtual method has an implementation and leaves an option to override it in the deriving class. Thus
Virtual method has an implementation & provides the derived class with the option of overriding it. Abstract method does not provide an implementation & forces the derived class to override the method.

5.             What is the difference between static or dynamic assemblies?
Answer: Assemblies can be static or dynamic. Static assemblies can include .NET Framework types (interfaces and classes), as well as resources for the assembly (bitmaps, JPEG files, resource files, and so on). Static assemblies are stored on disk in portable executable (PE) files. You can also use the .NET Framework to create dynamic assemblies, which are run directly from memory and are not saved to disk before execution. You can save dynamic assemblies to disk after they have executed.

6.             What are the difference between Structure and Class?
Answer:

§   Structures are value type and Classes are reference type.

§   Structures can not have constructors or destructors. Classes can have both constructors and destructors.

§   Structures do not support Inheritance, while Classes support Inheritance.

7.             What are the difference between const and readonly?
Answer:

§   A const can not be static, while readonly can be static.

§   A const need to be declared and initialized at declaration only, while a readonly can be initialized at declaration or by the code in the constructor.

§   A const’s value is evaluated at design time, while a readonly’s value is evaluated at runtime.

8.             Differences between dataset.clone and dataset.copy
Answer:
dataset.clone copies just the structure of dataset (including all the datatables, schemas, relations and constraints.); however it doesn’t copy the data. On the other hand dataset.copy, copies both the dataset structure and the data.

9.             Describe the difference between inline and code behind.
Answer: Inline code written along with the html and design blocks in an .aspx page. Code-behind is code written in a separate file (.cs or .vb) and referenced by the .aspx page.

10.          What is Difference between Namespace and Assembly?
Answer: Namespace is a logical design-time naming convenience, whereas an assembly establishes the name scope for types at run time.

11.          What is the difference between early binding and late binding?
Answer: Calling a non-virtual method, decided at a compile time is known as early binding. Calling a virtual method (Pure Polymorphism), decided at a runtime is known as late binding.

12.          What is the difference between Custom Control and User Control?
Answer:
Custom Controls are compiled code (Dlls), easier to use, difficult to create, and can be placed in toolbox. Drag and Drop controls. Attributes can be set visually at design time. Can be used by Multiple Applications (If Shared Dlls), Even if Private can copy to bin directory of web application add reference and use. Normally designed to provide common functionality independent of consuming Application. User Controls are similar to those of ASP include files, easy to create, can not be placed in the toolbox and dragged – dropped from it. A User Control is shared among the single application files.

13.          What is the difference between ASP Session State and ASP.Net Session State?
Answer: ASP session state relies on cookies, Serialize all requests from a client, does not survive process shutdown, Can not maintained across machines in a Web farm.

14.          Difference between ASP Session and ASP.NET Session?
Answer: Asp.net session supports cookie less session & it can span across multiple servers.

15.          Can you explain the difference between an ADO.NET Dataset and an ADO Recordset? (Repeated but more explanatory)
Answer:
In ADO, the in-memory representation of data is the recordset. In ADO.NET, it is the dataset. There are important differences between them.

o    A recordset looks like a single table. If a recordset is to contain data from multiple database tables, it must use a JOIN query, which assembles the data from the various database tables into a single result table. In contrast, a dataset is a collection of one or more tables. The tables within a dataset are called data tables; specifically, they are DataTable objects. If a dataset contains data from multiple database tables, it will typically contain multiple DataTable objects. That is, each DataTable object typically corresponds to a single database table or view. In this way, a dataset can mimic the structure of the underlying database. A dataset usually also contains relationships. A relationship within a dataset is analogous to a foreign-key relationship in a database —that is, it associates rows of the tables with each other. For example, if a dataset contains a table about investors and another table about each investor’s stock purchases, it could also contain a relationship connecting each row of the investor table with the corresponding rows of the purchase table. Because the dataset can hold multiple, separate tables and maintain information about relationships between them, it can hold much richer data structures than a recordset, including self-relating tables and tables with many-to-many relationships.

o    In ADO you scan sequentially through the rows of the recordset using the ADO MoveNext method. In ADO.NET, rows are represented as collections, so you can loop through a table as you would through any collection, or access particular rows via ordinal or primary key index. DataRelation objects maintain information about master and detail records and provide a method that allows you to get records related to the one you are working with. For example, starting from the row of the Investor table for “Nate Sun,” you can navigate to the set of rows of the Purchase table describing his purchases. A cursor is a database element that controls record navigation, the ability to update data, and the visibility of changes made to the database by other users. ADO.NET does not have an inherent cursor object, but instead includes data classes that provide the functionality of a traditional cursor. For example, the functionality of a forward-only, read-only cursor is available in the ADO.NET DataReader object.

o    Minimized Open Connections: In ADO.NET you open connections only long enough to perform a database operation, such as a Select or Update. You can read rows into a dataset and then work with them without staying connected to the data source. In ADO the recordset can provide disconnected access, but ADO is designed primarily for connected access. There is one significant difference between disconnected processing in ADO and ADO.NET. In ADO you communicate with the database by making calls to an OLE DB provider. In ADO.NET you communicate with the database through a data adapter (an OleDbDataAdapter, SqlDataAdapter, OdbcDataAdapter, or OracleDataAdapter object), which makes calls to an OLE DB provider or the APIs provided by the underlying data source. The important difference is that in ADO.NET the data adapter allows you to control how the changes to the dataset are transmitted to the database — by optimizing for performance, performing data validation checks, or adding any other extra processing. Data adapters, data connections, data commands, and data readers are the components that make up a .NET Framework data provider. Microsoft and third-party providers can make available other .NET Framework data providers that can be integrated into Visual Studio.

o    Sharing Data between Applications. Transmitting an ADO.NET dataset between applications is much easier than transmitting an ADO disconnected recordset. To transmit an ADO disconnected recordset from one component to another, you use COM marshalling. To transmit data in ADO.NET, you use a dataset, which can transmit an XML stream.

o    Richer data types.COM marshalling provides a limited set of data types — those defined by the COM standard. Because the transmission of datasets in ADO.NET is based on an XML format, there is no restriction on data types. Thus, the components sharing the dataset can use whatever rich set of data types they would ordinarily use.

o    Performance. Transmitting a large ADO recordset or a large ADO.NET dataset can consume network resources; as the amount of data grows, the stress placed on the network also rises. Both ADO and ADO.NET let you minimize which data is transmitted. But ADO.NET offers another performance advantage, in that ADO.NET does not require data-type conversions. ADO, which requires COM marshalling to transmit records sets among components, does require that ADO data types be converted to COM data types.

o    Penetrating Firewalls.A firewall can interfere with two components trying to transmit disconnected ADO recordsets. Remember, firewalls are typically configured to allow HTML text to pass, but to prevent system-level requests (such as COM marshalling) from passing.

–>by koti

2 Comments

  1. Hi Koti,

    Best thing I have read in a while on this Dot Net Interview Questions. There should be a standing ovation button. This is a great piece.

    I have created one DLL to use the following
    IGlobalInterfaceTable
    RegisterInterfaceInGlobal
    GetInterfaceFromGlobal

    This DLL works perfectly on my Windows XP machine.
    But when I try to use the same DLL on Windows 7 64bit, or Windows Server 2000 32bit, it Fails to work.
    An argument is an entity used to pass the data from calling function to the called function. Formal arguments are the arguments available in the function definition. They are preceded by their own data types. Actual arguments are available in the function call.

    Appreciate your effort for making such useful blogs and helping the community.

    Thanks a heaps,
    Mark

Leave a Reply

Your email address will not be published. Required fields are marked *

Enable Notifications OK No thanks