Beruflich Dokumente
Kultur Dokumente
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.
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.
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#
40
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.
3. Adaptation
Server controls automatically detects & adapts display appropriately.
HTML Controls - No automatic detection is possible.
4. Properties
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.
Data Reader - Forward only where as Dataset - Can loop through datas
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.
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.
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.
40
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.
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.
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.
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
.Net application
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.
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.
40
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.
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:
In addition, an application can designate a default Master Page in web.config as shown here:
<configuration>
<system.web>
<pages masterPageFile="~/ MyMasterPage.master " />
</system.web>
</configuration>
(b) PreCompilation
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.
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.
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.
40
A skin is a set of visual attributes applied to a control type. A theme is a collection of skins. There are a lot of
predefined themes in ASP.NET 2.0. One can use it by using the following line of code:
The page directive’s Them attribute declaratively applies a theme to a page. Themes can also be applied
programmatically using the page class’s Theme property
Structs vs classes in C#
Structs may seem similar to classes, but there are important differences that you should be aware of. First of all,
classes are reference types and structs are value types. By using structs, you can create objects that behave like
the built-in types and enjoy their benefits as well.
• When you call the New operator on a class, it will be allocated on the heap. However, when you instantiate
a struct, it gets created on the stack. This will yield performance gains. Also, you will not be dealing with
references to an instance of a struct as you would with classes. You will be working directly with the struct
instance. Because of this, when passing a struct to a method, it's passed by value instead of as a
reference.
• Structs can declare constructors, but they must take parameters. It is an error to declare a default
(parameterless) constructor for a struct. Struct members cannot have initializers. A default constructor is
always provided to initialize the struct members to their default values.
• When you create a struct object using the New operator, it gets created and the appropriate constructor is
called. Unlike classes, structs can be instantiated without using the New operator. If you do not use New,
the fields will remain unassigned and the object cannot be used until all the fields are initialized.
• There is no inheritance for structs as there is for classes. A struct cannot inherit from another struct or
class, and it cannot be the base of a class. Structs, however, inherit from the base class object. A struct
can implement interfaces, and it does that exactly as classes do,
• Structs are simple to use and can prove to be useful at times. Just keep in mind that they're created on
the stack and that you're not dealing with references to them but dealing directly with them. Whenever
you have a need for a type that will be used often and is mostly just a piece of data, structs might be a
good option.
Properties Indexers
Identified by its name. Identified by its signature.
Accessed through a simple name or a
Accessed through an element access.
member access.
Can be a static or an instance member. Must be an instance member.
40
A get accessor of a property has no A get accessor of an indexer has the same formal parameter list as the
parameters. indexer.
A set accessor of a property contains the A set accessor of an indexer has the same formal parameter list as the
implicit value parameter. indexer, in addition to the value parameter.
Which interface(s) must a class implement in order to support the foreach statement?
A class must implement the IEnumerable and IEnumerator interfaces to support the foreach statement.
C# provides many modifiers for use with types and type members. Of these, three can be used with classes:
abstract, sealed and static.
abstract
Indicates that a class is to be used only as a base class for other classes. This means that you cannot create an
instance of the class directly. Any class derived from it must implement all of its abstract methods and accessors.
Despite its name, an abstract class can possess non-abstract methods and properties.
sealed
Specifies that a class cannot be inherited (used as a base class). Note that .NET does not permit a class to be both
abstract and sealed.
static
Specifies that a class contains only static members (.NET 2.0).
This is all to do with polymorphism. When a virtual method is called on a reference, the actual type of the object
that the reference refers to is used to decide which method implementation to use. When a method of a base class
is overridden in a derived class, the version in the derived class is used, even if the calling code didn't "know" that
the object was an instance of the derived class. For instance:
public class Base
{
public virtual void SomeMethod()
{
}
}
...
Now, if you use the new keyword instead of override, the method in the derived class doesn't override the method
in the base class, it merely hides it. In that case, code like this:
public class Base
{
public virtual void SomeOtherMethod()
40
{
}
}
...
Will first call Base.SomeOtherMethod , then Derived.SomeOtherMethod . They're effectively two entirely separate
methods which happen to have the same name, rather than the derived method overriding the base method.
If you don't specify either new or overrides, the resulting output is the same as if you specified new, but you'll also
get a compiler warning (as you may not be aware that you're hiding a method in the base class method, or indeed
you may have wanted to override it, and merely forgot to include the keyword).
Name two ways that you can prevent a class from being instantiated.
An abstract class may contain both abstract and non-abstract methods. But an interface can contain only
abstract methods.
Use the using directive to create an alias for a long namespace or class. You can then use it anywhere you
normally would have used that class or namespace. The using alias has a scope within the namespace you declare
it in.
Sample code:
// Namespace:
using act = System.Runtime.Remoting.Activation;
// Class:
using list = System.Collections.ArrayList;
...
list l = new list(); // Creates an ArrayList
act.UrlAttribute obj; // Equivalent to System.Runtime.Remoting.Activation.UrlAttribute obj
40
What type of class cannot be inherited?
A sealed class cannot be inherited. A sealed class is used primarily when the class contains static members.
Note that a struct is implicitly sealed; so they cannot be inherited.
What keyword must a derived class use to replace a non-virtual inherited method?
new keyword is used to replace (not override) an inherited method with one of the same name.
What is an AppDomain? What is a process? What is thread? What is the difference between AppDomain
and process?
Process: A computer program is a set of instructions. Operating system executes a computer program by
allocating a process for a program. Several processes may be associated with the execution of a single program. A
process is an instance of machine code associated with a program. It has memory for instructions, data, a call
stack and a heap
AppDomain: An AppDomain is a light-weight process which separates one application in .NET with another. CLR
creates an AppDomain when an application is loaded. Each application will have an AppDomain associated. Each
AppDomain can have different threads running in it. Each app domain will have its associated code, data and
configuration. Hence when one application crashes, it does not affect other.
Thread: Each process can have multiple threads. Multiple threads can share same execution code and resources. A
multi-threaded process can perform several tasks concurrently.
.NET framework supports different type of applications like Web, windows, console etc,. Each type of application
needs a runtime host to start it. This runtime host loads the runtime into a process, creates the application with in
the process and loads the application code into the process.
ASP.NET: It loads the runtime that can handle a web request into the process. ASP.NET also creates an application
domain for each Web application that will run on a Web server.
Shell executables: When ever a runtime executable is launched from the shell, this executable invokes the
corresponding runtime host.
Code which targets the .NET framework CLR is manageable meaning CLR can provide its services like type safety,
memory management, exceptional handling etc to this type of code. Managed code is always compiled into MSIL.
When a .NET application is run this compiled MSIL is compiled to native code using JIT (Just In Time compiler).
This JIT generates the native code as per the hardware specification on the system. Since all this process happens
under the control of a managed environment CLR, CLR provides all its rich functionality. Managed code provides
platform independence since the code is converted to MSIL and then converted to native code depending on the
system architecture.
The code that does not target CLR is unmanageable. It cannot run under CLR. This code directly runs under OS
control. Applications written in traditional applications like C++, VB, C generate unmanaged code. This targets the
computer architecture. Unmanaged code is always compiled to target a specific architecture and will only run on
the intended platform. This means that if you want to run the same code on different architecture then you will
have to recompile the code using that particular architecture. Unmanaged code is always compiled directly to the
40
native code which is architecture specific. This code cannot be executed on other platforms that are different than
the one on which the code was compiled. All the features provided by CLR are unavailable and are to be taken care
by the code. Hence this causes memory leaks in traditional applications.
Value types: Value types inherit from the System.ValueType class, which in turn, inherits from System.Object.
Value types are stored on stack. They are implicitly sealed. Structs and Enumerations are value types and they are
always stored on stack. A value type cannot contain a null value. Variables that are value types store data.
Reference types: Variables to reference types referred to as object, store reference to actual data. Actual data is
stored on the heap and reference is stored on the stack. This allows the garbage collector to track outstanding
references to a particular instance and free the instance when no references remain.
Integral types : sbyte, byte, char, short, ushort, int, uint, long, ulong
Floating Point types: float, double
Decimal types: decimal
Objects created are stored on heap. Since the memory (here heap) is exhaustible, .NET identifies a mechanism to
collect the unused memory(heap). GC does an automatic sweep of heap once it is full. GC can only destroy
managed objects.
GC will finalize all the objects in the memory that are not being used anymore and thereby freeing the memory
allocated to them.
.NET uses a three-generation approach to collecting memory. Newly allocated memory tends to be freed more
frequently than older allocations, which tend to be more permanent. Gen 0 (Zero) is the youngest generation and,
after a garbage collection, any survivors go on to Gen 1. Likewise, any survivors of a Gen 1 collection go on to Gen
2. Usually garbage collection will occur only on Gen 0, and only if after it has reached some limit. Until memory is
exhausted, the cost of allocating each new object is that of incrementing a pointer--which is close to the
performance of advancing the stack pointer.
CLR calls the GC when there is a high memory pressure and it is not able to find any exact place to allocate a new
object or the applied threshold is reached.
40
Can you force Garbage collection if so how?
In applications with significant memory requirements, you can force garbage collection by invoking the GC.Collect
method from the program.
What is CLR?
CLS: Common Language specification is a set of rules that are to be followed by a language in order to be .NET
complaint. This facilitates cross-language integration. Programs written in one .NET language can interoperate with
programs written in another .NET language.
CTS: Common Type System Common Type System (CTS) describes how types are declared, used and managed.
CTS facilitates cross-language integration, type safety, and high performance code execution.
Type-safe code accesses only the memory locations it is authorized to access. For example, type-safe code cannot
read values from another object's private fields. It accesses types only in well-defined, allowable ways. If we want
to work directly with memory addresses and can manipulate bytes at these addresses then we have to declare that
code chunk as unsafe using the unsafe Keyword in C#. So that CLR will not do any extra verification on this code.
Actually during just-in-time (JIT) compilation, an optional verification process examines the metadata and Microsoft
intermediate language (MSIL) of a method to be JIT-compiled into native machine code to verify that they are type
safe. This process is skipped if the code has permission to bypass verification. For example, the runtime cannot
prevent unmanaged code from calling into native (unmanaged) code and performing malicious operations. When
code is type safe, the runtime's security enforcement mechanism ensures that it does not access native code
unless it has permission to do so. All code that is not type safe must have been granted Security Permission with
the passed enum member SkipVerification to run.
What is an assembly?
An assembly is a basic building block for an application. It can be a DLL or EXE. An assembly contains IL. It
consists of metadata about the types inside the assembly.
40
is written in XML with specific tags having specific meanings.
We have Machine.config file also. As 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.
What is DiffGram?
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.
What is EnabledViewState?
"EnableViewState" property - holds the state of the web control. View state holds the proprty details as a group of
a particular web control. And can be sent via HTTPEnable view state must eb enableed for transfering throught
he HTTP requests.If, the webserver control is using the database request, then it is advisable to make the Enable
viewState = false, to improve the processor performance, cause the database will overide the state.
In contrast, a user control will consist of previously built server controls (called constituent controls when used
within a user control). It has an interface that can be completely edited and changed. It can be manipulated at
design-time and runtime via properties that you are responsible for creating. While there will be a multitude of
controls for every possible function built by third-party vendors for ASP.NET, they will exist in the form of
compiled server controls, as mentioned above. Custom server controls may be the .NET answer to ActiveX Web
controls.
40
Diffrence Between ASP ASp.NET ?
The points of difference are as follows:
ASP.Net web forms have a code behind file which contains all event handling code. ASP does not have such facility
to separate programming logic from design.
ASP.Net web forms inherit the class written in code behind. ASP does not have the concept of inheritance.
ASP.Net web forms use full fledged programming language, while ASP pages use scripting language.
ASP.Net web applications are configurable (web.config) while ASP applications are not.
ASP.Net webforms can use custom controls through the @register directive, which is not available with ASP.
ASP.Net web forms have ADO.Net which supports XML integration and integration of data from two or more data
sources, while ASP has ADO which is a simple COM object with limited facilities.
ACID in transactions.
Ans.A transaction must be:
1.Atomic - it is one unit of work and does not dependent on previous and following transactions.
2.Consistent - data is either committed or roll back, no “in-between” case where something has
been updated and something hasn’t.
3.Isolated - no transaction sees the intermediate results of the current transaction).
4.Durable - the values persist if the data had been committed even if the system crashes right
after.
What is Cursor?
Cursor is a database object used by applications to manipulate data in a set on a row-by-row basis, instead of the
typical SQL commands that operate on all the rows in the set at one time. For example, you can use cursor to
include a list of all user databases and make multiple operations against each database by passing each database
name as a variable
Types of Directive?
Directives in ASP.NET control the settings and properties of page and user control compilers. They can be
included anywhere on a page, although it is standard to place them at the beginning. Directives are used in
both .aspx files (ASP.NET pages) and .ascx files (user control pages). ASP.NET pages actually support eight
different directives.
@ Page, @ Control, @ Import, @ Implements, @ Register, @ Assembly, @ OutputCache, @ Reference
What is AUTOEVENTWIREUP?
AutoEventWireup is a Boolean attribute that indicates whether the ASP.NET pages events are auto-wired.
Note: In the above case, ASP.NET compiles the code-behind page on the fly. We have to note that this
compilation step only occurs when the code-behind file is updated. Whether the file has been updated
or not, well this is detected through a timestamp change.
The AutoEventWireup attribute may have a value of true or false. When an ASP.NET Web Application is
created by using Microsoft Visual Studio .NET, the value of the AutoEventWireup attribute is set as
false.
We can specify the default value of the AutoEventWireup attribute in the following locations:
The Machine.config file.
The Web.config file.
Individual Web Forms (.aspx files).
Web User Controls (.ascx files)
The value of the AutoEventWireup attribute can be declared in the <pages> section in the Machine.config
file or the Web.config file.
We must not set the value of the AutoEventWireup attribute to true if performance is key consideration.
If we set the value of the AutoEventWireup attribute to true, the ASP.NET page framework must make a
call to the CreateDelegate method for every Web Form (.aspx page), and instead of relying on the
automatic hookup, manually override the events from the page.
40
directory, ASP.NET will dynamically recompile the components and automatically make them available to all the
pages in the Web site. Note that you should put only components into the Code subdirectory . You should not
put pages, Web user controls, or other non-code files ontaining non-code elements into this subdirectory.
To set the culture and UI culture for an ASP.NET Web page declaratively
To set the UI culture and culture for all pages, add a globalization section to the Web.config file, and then set
the uiculture and culture attributes, as shown in the following example:
<globalization uiculture="es" culture="es-MX" />
To set the UI culture and culture for an individual page, set the Culture and UICulture attributes of the @ Page
40
directive, as shown in the following example:
<%@ Page UICulture="es" Culture="es-MX" %>
What is Global Assembly Cache (GAC) and what is the purpose of it?
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.
40
{
//custom code
base.OnPreInit(e);
}
we can set theme programaticaly in preInit.
If the page is MasterPage after the Init() event starts, you can access these controls directly from the page
class. Why?
The reason being that all controls placed in the Content Page are within a ContentPlaceholder which is a child
control of a MasterPage. Now Master Page is merged and treated like a control in the Content Pages. As I
mentioned earlier, all events except the Init() and Unload() are fired from outermost to the innermost control. So
PreInit() in the Page is the first event to fire but User Controls or MasterPage (which is itself a Usercontrol) do not
have any PreInit event . Therefore in the Page_PreInit() method, neither the MasterPage nor any user control has
been initialized & only the controls inside the Page class are set to their default values.Only after the Page_PreInit()
event the Init() events of other controls fire up.
(2)OnInit()
In this event, we can read the controls properties (which is set at design time). We cannot read control values
changed by the user because that changed value will get loaded after LoadPostData() event fires. But we can
access control values from the forms POST data as:
string selectedValue = Request.Form[controlID].ToString();
(3)LoadViewState
This will only fire if the Page has posted back.Here the runtime de-serializes the view state data from the hidden
form element and loads all controls who have view state enabled.
(4)LoadPostBackData
In this event the controls which implement IPostBackDataHandler interface gets loaded by the values from the
HTTP POST data. Note that a textbox control does not gets its value from the view state but from the post data in
the form in this event. So even if you disable view state for a particular control, it can get its value from the HTTP
POST data if it implements IPostBackDataHandler interface.
Also,an important point to note is that if we have a DropDownList control and we have dynamically added some
items to it, the runtime cannot load those values unless the view state is enabled (even if the control derives
from IPostBackDataHandler). The reason being that HTTP Post data has only one value per control,and the entire
value collection is not maintained in the PostData but in view state.
(5)Page_Load
This method isfirst one for all beginner developers to put their code. Beginners may also think that this is the
first method which fires for a Page class. This can lead to a lot of confusion which makes understanding the Page
lifecycle all the more important.
Note:If the page has user control, then it's Load method will fire after the Page class's Load method. The reason
as explained earlier is the fact that all method except the Init() are fired from the outermost control to the
innermost. So after Page_Load(), load methods of all other controls are fired recursively.
(6)Control Event Handlers
These are basically event handlers(like Button1_Click()) which are defined for controls in the ASPX markup.
Another source of confusion arises when the developer thinks that an event handler like Button_Click()
should fire independently (like in windows apps) as soon as he clicks a Button on the web form, forgetting that
Page_Load will fire first before any event handlers.
(7)PreRender
This event is again recursively fired for all child controls in the Page. If we want to make any changes to control
values, this is the last event we have to peform the same.
(8)SaveViewState
Here, the ViewState of the controls gets saved in the form's hidden control.
(9)Render
In this method all controls are rendered recursively (i.e. Render method of each control is called).
(10)Unload
Here you can have the page and controls perform clean-up operations. This event has no relevance besides clean
up operations because the Page has already rendered.
40
What is DLL Hell ?
Dll hell problem is actualy registation and versionig probelem which is occure in vb6.0.this problem is solve in
.netframework in this every project has its own dll(dynamic link library) file.and this file is not overwrite by
dll file of another project when we instaling .netproject on machine where already install a .netframework project.
can you explain difference between .Net framework and .Net Compact Framework ?
Answer:-As the name suggest to us that .Net compact framework has been created with enabling managed code
on devices just like PDAs,mobiles etc. These are compact devices for which a .NET compact framework is
used.This is main diffrence between these two.
What is Delegate?
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.
40
(ISAPI) program to run to process the request. When request is for an ASP.NET page (.aspx file), IIS passes the
request to the ISAPI DLL capable of handling the request for ASP.NET pages, which is aspnet_isapi.dll.
what is MSIL?
MSIL supports OO programming, so we can have a class which has public and private methods. The entry point of
the program needs to be specified. In fact it doesn't really matter whether the method is called Mam or Dad. The
only thing that matters here is that .entrypoint is specified inside method. MSIL programs are compiled with ilasm
compiler. Since we are writing a managed assembly code, we have to make sure that no variables are allocated
in memory when the program goes out of scope.
Here is a more complicated program that, once again, does not do anything but has some dataThe sample MSIL
program.method
static void main(){ .entrypoint .maxstack 1 ldstr "Hello world!" call void
[mscorlib]System.Console::WriteLine(string) ret}
Hiding : - This is a C# Concept by which you can provide a new implementation for the base class member
without overriding the member. You can hide a base class member in the derived class by using the keyword
"new". The method signature,access level and return type of the hidden member has to be same as the base class
member.Comparing the three :-
1) The access level , signature and the return type can only be changed when you are shadowing with VB.NET.
Hiding and overriding demands the these parameters as same.
2) The difference lies when you call derived class object with a base class variable.In class of overriding although
you assign a derived class object to base class variable it will call derived class function. In case of shadowing or
hiding the base class function will be called.
40
HTML page may also contain hyperlinks to other HTML pages.A hyperlink(or just link) contains an address,
or a Uniform Resource Locator (URL), specifying where the target document is located. The resulting
combination of content and links is sometimes called hypertext and provides easy navigation to a vast
amount of information on the World Wide Web.
40
The first one should return the name of the machine, the second returns the local ip address.
Note that name of the machine could be different than host, since your site could be using
host headers.
40
to the database in a compiled form so that it can share between no of programs.
Some advantage of Store Procedure.
they allow faster execution
they can reduce network traffic
(1)Clustered:-
Clustered indexes helps in sorting and storeing the data rows in the table take key values as base. Because
the data rows are stored in sorted order on the clustered index key, clustered indexes more efficient for finding
rows. There is only one clustered index per table. The data rows themselves form the lowest level of the
clustered index. The only time the data rows in a table are stored in sorted order is when table contains a
clustered index. If a table has no clustered index, its data rows are stored in a heap.
(2)Nonclustered:-
Nonclustered indexes having structure that is diffrent from the data rows . The lowest rows of a nonclustered index
have the nonclustered index key values and each key value entry has pointers to the data rows containing the key
value. The data rows are not stored in order based on the nonclustered key. The pointer from an index row in a
nonclustered index to a data row is called a row locator. The structure of the row locator depends on whether
the data pages are stored in a heap or are clustered. In heap,a row locator is a pointer that point to the row. For a
table with a clustered index, the row locator is the clustered index key.
What is Property ?
A property is a thing that describes the features of an object. A property is a piece of data contained within
class that has an exposed interface for reading/writing. Looking at that definition, you might think you could
declare a public variable in a class and call it a property. While this assumption is somewhat valid, the true
technical term for a public variable in a class is a field. The key difference between a field and a property
is in the inclusion of an interface.
We make use of Get and Set keywords while working with properties. We prefix the variables used within this
code block with an underscore. Value is a keyword, that holds the value which is being retrieved or set.
40
What does the term immutable mean?
Ans.It means to create a view of data that is not modifiable and is temporary of data that is modifiable.Immutable
means you can't change the currrent data,but if you perform some operation on that data, a new copy is created.
The
operation doesn't change the data itself. Like let's say you have a string object having "hello" value. Now if you
say
temp = temp + "new value"
a new object is created, and values is saved in that. The temp object is immutable, and can't be changed. An
object
qualifies as being called immutable if its value cannot be modified once it has been created. For example, methods
that appear to modify a String actually return a new String containing the modification. Developers are modifying
strings all the time in their code. This may appear to the developer as mutable - but it is not. What actually
happens is your string variable/object has been changed to reference a new string value containing the results of
your new string value. For this very reason .NET has the System.Text.StringBuilder class. If you find it necessary
to modify the actual contents of a string-like object heavily, such as in a for or foreach loop, use the
System.Text.StringBuilder class.
Define basic functions for master, msdb, tempdb databases in Sql Server ?
1)master:-It contains system level information for a SQL Server system and also contains login accounts
and all system configuration settings. master is the database that records the existence of all other
databases, including the location of the database files.
(2) tempdb - This database holds all temporary tables and temporary stored procedures. It also fills any
other temporary storage needs such as work tables generated by SQL Server. tempdb is re-created every
time SQL Server is started so the system starts with a clean copy of the database.
(3)model - The model database is used as the template for all databases created on a system. When a
CREATE DATABASE statement is issued, the first part of the database is created by copying in the contents
of the model database, then the remainder of the new database is filled with empty pages. Because tempdb
is created every time SQL Server is started, the model database must always exist on a SQL Server system.
(4)msdb - The msdb database is used by SQL Server Agent for scheduling alerts and jobs, and recording
operators.
What is LDAP ?
LDAP is a networking protocol for querying and modifying directory services running over TCP/IP.To explain LDAP
we take a example of telephone directory, which consists of a series of names organized alphabetically, with an
address and phone number attached.To start LDAP on client it should be connect with server at TCP/IP port
389.The client can send multiple request to the server.The basic operations are:-
Start TLS - protect the connection with Transport Layer Security (TLS), to have a more secure connection
Bind - authenticate and specify LDAP protocol version
Search - search for and/or retrieve directory entries
Compare - test if a named entry contains a given attribute value
Add a new entry
Delete an entry
Modify an entry
Modify DN - move or rename an entry
Abandon - abort a previous request
Extended Operation - generic operation used to define other operations
Unbind - close the connection (not the inverse of Bind)
What is RAD ?
40
Rapid application development (RAD), is a software development process developed initially by James Martin in
the 1980s. The methodology involves iterative development, the construction of prototypes, and the use of
Computer-aided software engineering (CASE) tools. Traditionally the rapid application development approach
involves compromises in usability, features,& /or execution speed.Increased speed of development through
methods including rapid prototyping,virtualization of system related routines, the use of CASE tools, and other
techniques. Increased end-user utility Larger emphasis on simplicity and usability of GUI design.Reduced
Scalability, and reduced features when a RAD developed application starts as prototype and evolves into a finished
application Reduced features occur due to time boxing when features are pushed to later versions in order to finish
a release in a short amount of time.
What are the GLOBAL and LOCAL cursor in SQL SERVER 2005 ?
Answer:-When we are creating a cursor by default it is Global. When is global by default we can access it from
outside also. But on the other side local cursor are only accesible inside the objects these objects can be anything
just like Stored Procedure,Trigger and funtion. we can also declare cusror as local or global its up to us.
40
Can You explain the syntax of ISNULL() in SQL SERVER ?
Answer:-Returns a Boolean value that indicates whether an expression contains no valid data we can also use this
as conditional operator and also as if else loop.
syntax:-
isNull("dotnet","SQL")
if condition is true then its return dotnet
if not then SQL
What is Class ?
A class is an organized store-house in object-oriented programming that gives coherent functional abilities to a
group of related code. It is the definition of an object, made up of software code. Using classes, we may wrap data
and behaviour together (Encapsulation).We may define classes in terms of classes (Inheritance).We can also
override the behaviour of a class using an alternate behaviour (Polymorphism).
40
we can make daemon thread by
Thread.Isbackground=true
ADO .NET
How to get database schema information when connection object is establish in ADO.NET ?
Answer: There is a method that helps in getting schema information that is GetSchema() and this method is called
40
in three different ways first way when we call this method without any parameter its return the metadata(table,
view, stored procedure.indexes etc).When method is called by passing metadata collection name and filter criteria
returns the items from the collection after applying the filter criteria and last way is when we called by passing a
metadata collection name returns information about items found in the specified collection.
dr= cmd.ExecuteReader(CommandBehavior.CloseConnection);
The associated connection will be closed automatically when the Close method of the Datareader is called. This
makes it all the more important to always remember to call Close on your datareaders.
Which method do you invoke on the DataAdapter control to load your generated dataset with data?
Answer: The Fill() method.
40
DiffGram. For more information, see Loading a DataSet from XML and Writing a DataSet as XML Data. While the
DiffGram format is primarily used by the .NET Framework as a serialization format for the contents of a DataSet,
you can also use DiffGrams to modify data in tables in a Microsoft SQL Server™ 2000 database.
What are good ADO.NET object(s) to replace the ADO Recordset object?
Answer: There are alot...but the base once are SqlConnection, OleDbConnection, etc...
Can you explain the difference between an ADO.NET Dataset and an ADO Recordset?
Answer:Valid answers are:
• A DataSet can represent an entire relational database in memory, complete with tables, relations, and
views.
• A DataSet is designed to work without any continuing connection to the original data source.
• Data in a DataSet is bulk-loaded, rather than being loaded on demand.
• There's no concept of cursor types in a DataSet.
• DataSets have no current record pointer You can use For Each loops to move through the data.
• You can store many edits in a DataSet, and write them to the original data source in a single operation.
• Though the DataSet is universal, other objects in ADO.NET come in different versions for different data
sources.
Can you have two files with the same file name in GAC?
40
Answer: GAC is just a Folder that contains .dll that have strong name.We can say that GAC is a very special folder,
and it is not possible two place two files with the same name into a Windows folder,But GAC differentiates by
version number as well, so it’s possible for MyApp.dll and MyApp.dll to co-exist in GAC if the first one is version
1.0.0.0 and the second one is 1.1.0.0.
Shared assembly can be used by multiple applications and has to have a strong name.
Whats an assembly ?
Answer: Assemblies are the building blocks of .NET Framework applications; they form the fundamental unit of
deployment, version control, reuse, activation scoping, and security permissions. An assembly is a collection of
types and resources that are built to work together and form a logical unit of functionality. An assembly provides
the common language runtime with the information it needs to be aware of type implementations. To the runtime,
a type does not exist outside the context of an assembly.
How can you tell the application to look for assemblies at the locations other than its own install ?
Answer: Use the directive in the XML .config file for a given application.
should do the trick. Or you can add additional search paths in the Properties box of the deployed application.
40
Where’s global assembly cache located on the system ?
Answer: Usually C:\winnt\assembly or C:\windows\assembly.
How do you specify a custom attribute for the entire assembly (rather than for a class) ?
Answer: Global attributes must appear after any top-level using clauses and before the first type or namespace
declarations. An example of this is as follows:
using System;
[assembly : MyAttributeClass] class X {}
Note that in an IDE-created project, by convention, these attributes are placed in AssemblyInfo.cs.
ASP .NET
40
work are done through the tables.
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.
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 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.
40
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.
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.
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:
40
Server-side options are:
Use 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.
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 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.)
Programmers understand that they're responsible for releasing any memory that they allocate, but they're not very
40
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.
What Is OOPS ?
Answer: OOPs is an Object Oriented Programming language,which is the extension of Procedure Oriented
programming language.OOPS reduce the code of the program because of the extensive feature of Polymorphism.
OOPS have many properties such as Data-Hiding,Inheritence,Data Absraction,Data Encapsulation and many
moreEverything in the world is an object. The type of the object may vary. In OOPS, we get the power to create
objects of our own, as & when required.
what is Class ?
Answer:A group of objects that share a common definition and that therefore share common properties,
operations, and behavior. A user-defined type that is defined with the class-key 'class,' 'struct,' or 'union.' Objects
of a class type consist of zero or more members and base class objects.Classes can be defined hierarchically,
allowing one class to be an expansion of another, and classes can restrict access to their members.
What is Constructor?
Answer:When we create instance of class a special method of that class, called that is constructor. Similarly, when
the class is destroyed, the destructor method is called. These are general terms and usually not the actual member
names in most object-oriented languages. It is initialized using the keyword New, and is destroyed using the
keyword Finalize.
What is ValueType?
Answer:Value Types - Value types are primitive types. Like Int32 maps to System.Int32, double maps to
System.double.All value types are stored on stack and all the value types are derived from System.ValueType. All
structures and enumerated types that are derived from System.ValueType are created on stack, hence known as
ValueType.In value type we create a copy of object and uses there value its not the original one.
SQL SERVER
40
What is Cascade and Restrict when we use DROP table in SQL SERVER ?
Answer:- When we are using Drop table in SQL the syntax is simple.
Drop table table_name(CASCADE / RESTRICT)
We use cascade to drop table although it have some dependencies just like
triggers,stroeprocrdure,primarykey,foreignkey it will delete first.
But if we use restrict a error message is shown on using of DROP if the table have relation Trigger,storeprocedure.
Can You explain integration between SQL Server 2005 and Visual Studio 2005 ?
Answer: This intergration provide wider range of development with the help of CLR for database server.Becasue
CLR helps developers to get flexibility for developing database applications and also provides language
interoperability just like Visual C++, Visual Basic .Net and Visual C# .Net. The CLR helps developers to get the
arrays, classes and exception handling available through programming languages such as Visual C++ or Visual C#
which is use in stored procedures, functions and triggers for creating database application dynamically and also
provide more efficient reuse of code and faster execution of complex tasks. We particularly liked the error-checking
powers of the CLR environment, which reduces run-time errors
40
the other hand UNION statement does look for duplicate rows, whether or not they exist.
40
What is defaults in Sql Server and types of Defaults ?
Answer: Defaults are used when a field of columns is allmost common for all the rows for example in employee
table all living in delhi that value of this field is common for all the row in the table if we set this field as default the
value that is not fill by us automatically fills the value in the field its also work as intellisense means when user
inputing d it will automatically fill the delhi . There are two types of defaults object and definations.
Object deault:-These defaults are applicable on a particular columns . These are usually deined at the time of table
designing.When u set the object default field in column state this column in automatically field when u left this filed
blank.
Defination default:-When we bind the datatype with default let we named this as dotnet .Then every time we
create column and named its datatype as dotnet it will behave the same that we set for dotnet datatype.
What Is Database ?
Answer: A database is similar to a data file in that it is a storage place for data. Like a data file, a database does
not present information directly to a user; the user runs an application that accesses data from the database and
presents it to the user in an understandable format.Database systems are more powerful than data files in that
data is more highly organized. In a well-designed database, there are no duplicate pieces of data that the user or
application must update at the same time. Related pieces of data are grouped together in a single structure or
record, and relationships can be defined between these structures and records.When working with data files, an
application must be coded to work with the specific structure of each data file. In contrast, a database contains a
catalog that applications use to determine how data is organized. Generic database applications can use the catalog
to present users with data from different databases dynamically, without being tied to a specific data format. A
database typically has two main parts: first, the files holding the physical database and second, the database
management system (DBMS) software that applications use to access data. The DBMS is responsible for enforcing
the database structure, including: · Maintaining relationships between data in the database. Ensuring that data is
stored correctly, and that the rules defining data relationships are not violated. · Recovering all data to a point of
known consistency in case of system failures.
40
· Adding records to a related table if there is no associated record in the primary table.
· Changing values in a primary table that result in orphaned records in a related table.
· Deleting records from a primary table if there are matching related records.
For example, with the sales and titles tables in the pubs database, referential integrity is based on the relationship
between the foreign key (title_id) in the sales table and the primary key (title_id) in the titles table.
User-Defined: Integrity User-defined integrity allows you to define specific business rules that do not fall into one
of the other integrity categories. All of the integrity categories support user-defined integrity (all column- and
table-level constraints in CREATE TABLE, stored procedures, and triggers).
SQL Server runs on which TCP/IP port and From where can you change the default port?
Answer: SQL Server runs on port 1433 but we can also change it for better security and From the network Utility
TCP/IP properties -->Port number.both on client and the server.
What is Normalization ?
Answer: The logical design of the database, including the tables and the relationships between them, is the core of
an optimized relational database. A good logical database design can lay the foundation for optimal database and
application performance. A poor logical database design can impair the performance of the entire system.
Normalizing a logical database design involves using formal methods to separate the data into multiple, related
tables. A greater number of narrow tables (with fewer columns) is characteristic of a normalized database. A few
wide tables (with more columns) is characteristic of an nonnomalized database. Reasonable normalization often
improves performance. When useful indexes are available, the Microsoft® SQL Server™ 2000 query optimizer is
efficient at selecting rapid, efficient joins between tables.
As normalization increases, so do the number and complexity of joins required to retrieve data. Too many complex
relational joins between too many tables can hinder performance. Reasonable normalization often includes few
regularly executed queries that use joins involving more than four tables.
Sometimes the logical database design is already fixed and total redesign is not feasible. Even then, however, it
might be possible to normalize a large table selectively into several smaller tables. If the database is accessed
through stored procedures, this schema change could take place without affecting applications. If not, it might be
possible to create a view that hides the schema change from the applications.
40
How to get which Process is Blocked in SQL SERVER ?
Answer:- There are two ways to get this sp_who and sp_who2 . You cannot get any detail about the sp_who2
but its provide more information then the sp_who . And other option from which we can find which process is
blocked by other process is by using Enterprise Manager or Management Studio, these two commands work much
faster and more efficiently than these GUI-based front-ends.
VB .NET
40
unmanaged program execution. We will also learn .NET framework provides highly secure and fault-tolerant
execution environment.
Now to start .Net Framework we have to cover Microsoft .NET we can say that Microsoft .NET is a software that
helps us to create application for different environment and for different devices for example we can create a
application for mobile so it's a device application and also can create a XML Web Services for highly distributed
environment just like Internet. In .NET we can also create traditional window-based application as well as server
components and device application too .net helps to exchange data between various applications and devices. Here
.NET provides tools, environment, infrastructure and impressive software which help us to build application for
different platform and for devices too.
We can integrate between various application and devices by using standard just like hypertext transfer protocol
(HTTP),XML and soap (Simple Object Access Protocol). Another good feature is to exchange data by using XML Web
Services that really changes the environment .Another good feature is .NET provides remoting that work in two
different platform .By using binary or HTTP protocols.
Here i have discuss some enhancement that is done in different version of dot net.
(1) .NET Framework 1.0
The first release of the .NET Framework. Was on February 13, 2002. Its helpsfull in Windows 98, NT 4.0, 2000,
and XP.
(2).NET Framework 1.1
- New mobile controls are taken in ASP.NET.
- Security changes - Code Access Security in ASP.NET applications is done in new ways.
- A new Built-in support for ODBC and Oracle databases are comes in existing manner .
- Compact framework is taken as new version for small devices.
- Internet Protocol version 6 (IPv6) support.
- Numerous API changes.
(3).NET Framework 2.0
- Numerous API changes extend the limit.
- A new hosting API for native applications wishing to host an instance of the .NET runtime. The new API
gives a fine grain control
on the behavior of the runtime with regards to multithreading, memory allocation, assembly loading and more
(detailed reference). It was initially developed to efficiently host the runtime in Microsoft SQL Server, which
implements its own scheduler and memory manager.
- Full 64-bit support for both the x64 and the IA64 hardware platforms.
- Language support for Generics built directly into the .NET CLR.
- Many additional and improved ASP.NET web controls.
- New data controls with declarative data binding.
- New personalization features for ASP.NET, such as support for themes, skins and webparts.
- .NET Micro Framework - a version of the .NET Framework related to the Smart Personal Objects
Technology initiative.
(3) .NET Framework 3.0
.NET Framework 3.0 consists of four major new components:
- Windows Presentation Foundation (WPF) This based on XML and vector graphics, we can also say its uses
3D computer graphics hardware and Direct3D technologies.
- Windows Communication Foundation (WCF),It is a messaging system which helps programs to
interoperate locally or remotely similar to web services.
- Windows Workflow Foundation (WF) this helps in task just like automation and integrated transactions
using workflows.
- Windows CardSpace, It is software component to securely stores a person's digital identities and provides a
unified interface for choosing the identity.
40
- Support for HTTP pipelining and syndication feeds.[19]
- ASP.NET AJAX is included
Microsoft visual Studio .NET and .NET Framework provides a solution a variety of programming environment and
languages that provides a single point access to all the tool that's we need.
Now turn of .NET framework what is can do what it can do what it do and area that covers under it explain here .
The .NET framework provides environment to create object-oriented programming model that's helps us to create
all type of application .Here the methods of creating window-based application or we can say window-based
components is same as creating XML Web Services is same. When we create a .NET application we create a class
that class contains or define the functionality of the application in term of properties event and methods of that
class .Also in web application the code that control on web application comes under that class. These classes can
take advantage of Object oriented popular feature just like Inheritance, encapsulation and polymorphism. So we
can also say that classes are the fundamental for programming in .Net environment .We can also create classes in
any of language that supported by .NET another factor is reusable of class whether it is different language. We can
inherit classes across languages because .NET framework allows language interoperability and also supports cross-
language inheritance.
There is CLS(common language specification) which contains the rules for different language interoperability .The
code that is written in CLS-complaint language is interoperable with code contains in cls-complaint different
language .The .NET framework provide four CLS-complaint language just like Visual Basic .NET,Micosoft Visual
C#,Microsoft Visual C++ .NET and Microsoft J# .NET. When we complies these languages its gernate an
intermediate code called (MSIL) which helps program to be interoperable .The .NET framework provides the
infrastructure and services per the CLI (Common Language Infrastructure) specification.There are the following
services:
*Common Language Runtime:- This contains CLI (common language infrastructure) and provides a environment or
we can say provides execution environment .Because all .NET language compiler compile the source code into MSIL
code and this code is loads and executes when we run application by CLR.
*Common Type System:-This provides the data type value and object types, which helps in developing application
in different language , because all .NET languages share CTS .This means when we take string in Visual Basic it is
same in Visual C# and in other .NET languages means there is no superior language all are similar .
*Type Safety:-This means as the name suggest any operation is performed on one value or object is only perform
on that value or object not for other.
*Managed Code Execution:-When we loads and execute .NET application and objects state are managed when
application is in execution .NET framework automatically allocates memory and provides an automatic garbage
collection mechanism.
*Side-By-Side execution:-The .Net framework helps in deployment of multiple versions of same application by
using assembly. The CLR uses the version information in the metadata to get application and helps in getting
multiple version of an application side-by-side.
After this we are unable to understand about what .NET framework is and define its architecture:-
The .NET framework consists of two main components first we can say .Net Framework class library and the second
we can say is Common Language Runtime .The framework class library contains the library that provides the types
that are common to all .NET languages. This libraries helps in developing different types of application such as
console application, window and the Web Form and also help full in creation of Web Services.
And another component is common language runtime consists of components that loads the IL code of program in
to the runtime and soon after this IL code convert into native code, this execute and mange the code and helps in
enforcing security and also helps in type safety and provide thread support and some other useful services .The
code that is run in common language runtime is called managed code on the other hand that is not run in common
language runtime is called unmanaged code .The CLR provides an interoperability layers ,which helps in both
managed code and in unmanaged code.
Now we explain various components of CLR that's make them useful component of .Net Framework.
40
• Class Loader:-its helps CLR to load classes in runtime environment.
• Complier:-its helped in converting MSIL to native code
• Code Manager:-This helps in managing the code during execution
• Garbage Collector:-Its perform automatic memory management.
• Security Engine:-This helps in enforcing security restrictions.
• Type Checker:-It performs type checking.
• Thread Support:-Its helps in doing Multiple threading concepts.
• Exception Manager:- Its provides a method to handle the exception at runtime
• Debug Engine:-Its allowed debug different types of applications
• Com Marshler:- Its allows .Net Application to exchange data with com application.
40
40