What is an abstract class?
An abstract class is a class which can't be instantiated and it may contain at least 1 abstract method (a method without any body), but it is not necessary that it should have all abstract methods.
Abstract class is a class for which we can not create an instance but can be inherited. Abstract class contains both abstract methods and general methods. The methods which we declared as abstract doesn't contain any
definition. We have to override the abstract methods when we are using them in other classes. Only we can derive a child class from the abstract class
What is CLR? 2.1. Diff between CLR & CTS
CLR is the Common Language Runtime for the dotnet frame work.
CTS is the Common Type Sytem for all languages.It consists of the types(Class,Enums,Structs,Interfaces etc for any language)
CTS is one of the component of CLR.
CLR is run time execution environment for .Net, It provides runtime as well as compile time services. e.g Memory Management, debuging CLR works with the CLS (Common Language Specification) and CTS (Common Type Systems) to ensure language interoperability.
A CLR is a construct provide by the .NET framework that provides several functionalities to all .NET applications like memory management,security,language independency etc.it is common language runtime.CTS is common type specification that consists of all the types supported by .NET like bool,struct,enum etc; and thus keeps the .net applications typesafe
Common Language Runtime (CLR) manages the execution of code and provides different services like Garbage collection and support for Base Class Libraries etc. The main constituents of CLR are described below
The common Language Runtime (CLR) a rich set of features for cross-language development and deployment. CLR supports both Object Oriented Languages as well as procedural languages. CLR provides security, garbage collection, cross language exception handling, cross language inheritance and so on.
The Common Type System, support both Object Oriented Programming languages as well as procedural languages. Basically CTS provides rich type system that is intended to support wide range of languages.
CLS (Common Language Specification) defines a subset of Common Type System, which all language compilers targeting CLR must adhere to. CLS is a subset of CTS.
All compilers under .NET will generate Intermediate Language no matter what language is used to develop an application. In fact, CLR will not be aware of the language used to develop an application. All language compilers will generate a uniform, common language called Intermediate Language. For this reason IL can be called as The language of CLR A platform for cross language development.
can an abstract method be overridden by a virtual ...
An abstract method is a method without any method body. When a class inherits from an abstract class, the derived class must implement all the abstract methods declared in the base class. But by declaring the derived class also abstract, we can avoid the implementation of all or certain abstract methods. This is what is known as partial implementation of an abstract class.
A virtual method specifies an implementation of a method than can be polymorphically override in the derived class. When we declare a virtual method, it must contain a method body. It is not necessary to override a base class virtual method inside a derived class.
The abstract methods are implicitly virtual and hence they cant make explicitly virtual in c#
What is the difference between html and asp.net co...
MCSD Kits Lists 4 Differences
1. Server Controls Trigger Server side events. Whereas HTML controls only trigger client side events.
2. State Management
Server Controls provides State Management - Dataentered in a control is maintained across requests. State Management in HTML Controls can be achieved usingPage-level scripts.
Server controls automatically detects & adapts display appropriately. HTML Controls - No automatic detection is possible.
Server controls - Provides a good set of properties that can bemanipulated from server side code. HTML Controls - It has the basic set of HTML attributes attachedto each element.
Diff between Dataset and Datareader?
Data Reader - Forward only where as Dataset - Can loop through datas
Data Reader - Connected Recordset where as DataSet - Disconnected Recordset
Data Reader - Less Memory Occupying where as DataSet - It occupies more memory
Data Reader - Only Single Table can be used where as Dataset - Datatable Concept allows data to be stored in multiple tables.
Data Reader - Read only where as DataSet - Can add/update/delete using the dataset
Data Reader - No relationship can be maintained where as DataSet - Relationship can be maintained. Data Reader - No Xml Storage available where as DataSet - Can be stored as XML.
How does VB.NET/C# achieve polymorphism?
Having multiple methods with different signature is not polymorphism. That is function overloading.
I am afraid this is also one form of polymorphism and is called Compile-time polymorphism.
Polymorphism allows you to use a particular object as multiple types, that is its own type and the base types. It is achieved through inheritance. The derived class can have the behaviour of the base class or can define its own behaviour by overriding the virtual functions of the base class.
This is runtime polymorphism
What are delegates?
A delegate is a class that can hold a reference to a method. Unlike other classes, a delegate class has a signature, and it can hold references only to methods that match its signature. A delegate is thus equivalent to a type-safe function pointer or a callback.
delegates are like refernce or pointers to the methods. A delegate is a reference type that cna be used to encapsulate a method.
A Delegate is Passing a method as an Argumement to a Existing method to create an Event
Which namespace is used to get assembly details?
System.Reflection is used to get data about assembly
What is IPostBack? How to use it?
IPostBack is an interface which defines the methods ASP.NET server controls must implement to handle post back events.
To create a server control that captures the form submission information from the browser, you must implement this interface.
what is event bubbling?
Event Bubbling is nothing but events raised by child controls is handled by the parent control. Example: Suppose consider datagrid as parent control in which there are several child controls.There can be a column of link buttons right.Each link button has click event.Instead of writing event routine for each link button write one routine for parent which will handlde the click events of the child link button events.Parent can know which child actaully triggered the event.That thru arguments passed to event routine.
Why Datareader is useful?
Well, Dataset is used for distributed environment where the data source is often disconnected and is not
available..so we fetch data and store it in memory..overhead on memory(consider each request having more than
1000 records and there are thousands of request..)But Datareader as said above is used for connected
environment so it provides greater efficiency by direct menipulating the data at server...Hence it is used where DB
server and application have reliable connected media...eg web..you dont need to hold 1000 records in memory in this case....
Data Reader is used to go through the records in a particular order. It can be either forward order or backward order.
What is DLL hell?
DDL hell is the problem of registering the DDL,.NET remove this problem by assemblies because assemblies has its own meta data thats why it dose'nt require the registration.
What is an assembly
Assembly is a collection of code files , types and resources. It is a unit of deployment,version cotrol and reuse.Assembly is basically collection of exe or dll files which are generated upon successfull compilation of the
An assembly is a collection of one or more files grouped together to form a logical unit. The term “files” in this
context generally refers to managed modules, but assemblies can include files that are not managed modules. Most assemblies contain just one file, but assemblies can and sometimes do include multiple files. All the files that make
up a multifile assembly must reside in the same directory. When you use the C# compiler to produce a simple EXE,
that EXE is not only a managed module, it’s an assembly. Most compilers are capable of producing managed modules that aren’t assemblies and also of adding other files to the assemblies that they create. The .NET Framework SDK also includes a tool named AL (Assembly Linker) that joins files into assemblies.
Explain what a diffgram is, and a good use for one...
A DiffGram is an XML format that is used to identify current and original versions of data elements. The DataSet uses the DiffGram format to load and persist its contents, and to serialize its contents for transport across a network connection. When a DataSet is written as a DiffGram, it populates the DiffGram with all the necessary information to accurately recreate the contents, though not the schema, of the DataSet, including column values
from both the Original and Current row versions, row error information, and row order.When sending and retrieving
a DataSet from an XML Web service, the DiffGram format is implicitly used. Additionally, when loading the contents
of a DataSet from XML using the ReadXml method, or when writing the contents of a DataSet in XML using the
WriteXml method, you can select that the contents be read or written as a DiffGram.
What is GAC? What are Strong and Weak Types? Global Assembly Cache
Each computer where the common language runtime is installed has a machine-wide code cache called the global assembly cache. The global assembly cache stores assemblies specifically designated to be shared by several applications on the computer.
You should share assemblies by installing them into the global assembly cache only when you need to. As a general guideline, keep assembly dependencies private, and locate assemblies in the application directory unless sharing an assembly is explicitly required. In addition, it is not necessary to install assemblies into the global assembly cache
to make them accessible to COM interop or unmanaged code.
What are the main differences between .net 1.1 and...
ASP.NET 2.0 introduces a lot of new features. Some of this features aim to simplify the problems faced using the earlier versions and some features are introduced to provide lot of new facilities.
The most important features that are incorporated in ASP.NET 2.0 are:
(a) Master Pages
Master pages are introduced to remove one of the most important deficiencies of earlier version of ASP.NET. One thing that has become apparent in the earlier version of ASP.NET is the lack of architecture for applying a consistent look and feel. In earlier version of ASP.NET whenever a developer wants to replicate a common functionality of a web page in other pages, the most possible options he uses is creating a user control and then replicate the functionality in other pages.
ASP.NET 2.0 aims to solve this problem by introducing the concept of Master pages. First the developer needs to define a master page containing the content that he wants to appear on other pages and then use the
ContentPlaceHolder controls to define the locations where the sub pages can plug in the content of their own. The
he has to build the sub pages - .aspx pages – that reference the master using directives like this one:
<%@Page MasterPageFile = ~/MyMasterPage.master” %>
In addition, an application can designate a default Master Page in web.config as shown here:
<pages masterPageFile="~/ MyMasterPage.master " />
By default, ASP.NET web pages and code files are compiled dynamically when a first request is made to the page. After the initial compilation, the compiled pages is cached; the cache is used to satisfy the subsequent requests for
the same page. Even though this approach is flexible, when the page is requested for the first time, it requires a bit
of extra time to compile the code. You can avoid this overhead by leveraging a new feature known as
precompilation; by using this feature, you can compile an ASP.NET web site before making the web site available to the users.
(c) Sharing code in the application
In earlier version of ASP.NET, if you were to reference a reusable component from your dot net application, you
had to compile the assembly and place it in the bin folder (or place it in the GAC) of the web application. But now
with ASP.NET 2.0, creating a reusable component is very simple and straightforward. All you need to do is to create
a component in a pre-defined subdirectory called code. Any component placed in this directory will be automatically compiled at runtime into a single assembly. This assembly is automatically referenced and will be available to all
the page in the site.
(d) Themes and Skins
ASP.NET 2.0 introduces the concepts of Themes and Skins by means of which the look and feel of the web pages can be enhanced to a great extent to make them visually catchy and attractive.