C# Interview Questions

Does C# support multiple-inheritance?

No.

Who is a protected class-level variable available to?

It is available to any sub-class (a class inheriting this class).


Are private class-level variables inherited?

Yes, but they are not accessible. Although they are not visible or accessible via the class interface, they are inherited.

Describe the accessibility modifier “protected internal”.

It is available to classes that are within the same assembly and derived from the specified base class.

What’s the top .NET class that everything is derived from?

System.Object.

What does the term immutable mean?

The data value may not be changed. Note: The variable value may be changed, but the original immutable data value was discarded and a new data value was created in memory.

What’s the difference between System.String and System.Text.StringBuilder classes?

System.String is immutable. System.StringBuilder was designed with the purpose of having a mutable string where a variety of operations can be performed.

What’s the advantage of using System.Text.StringBuilder over System.String?

StringBuilder is more efficient in cases where there is a large amount of string manipulation. Strings are immutable, so each time a string is changed, a new instance in memory is created.

Can you store multiple data types in System.Array?

No.

What’s the difference between the System.Array.CopyTo() and System.Array.Clone()?

The Clone() method returns a new array (a shallow copy) object containing all the elements in the original array. The CopyTo() method copies the elements into another existing array. Both perform a shallow copy. A shallow copy means the contents (each array element) contains references to the same object as the elements in the original array. A deep copy (which neither of these methods performs) would create a new instance of each element's object, resulting in a different, yet identacle object.

How can you sort the elements of the array in descending order?

By calling Sort() and then Reverse() methods.

What’s the .NET collection class that allows an element to be accessed using a unique key?

HashTable.

What class is underneath the SortedList class?

A sorted HashTable.

Will the finally block get executed if an exception has not occurred?­

Yes.

What’s the C# syntax to catch any possible exception?

A catch block that catches the exception of type System.Exception. You can also omit the parameter data type in this case and just write catch {}.

Can multiple catch blocks be executed for a single try statement?

No. Once the proper catch block processed, control is transferred to the finally block (if there are any).

Explain the three services model commonly know as a three-tier application.

Presentation (UI), Business (logic and underlying code) and Data (from storage or other sources).

What is the syntax to inherit from a class in C#?

Place a colon and then the name of the base class. Example: class MyNewClass : MyBaseClass

Can you prevent your class from being inherited by another class?

Yes. The keyword “sealed” will prevent the class from being inherited.

Can you allow a class to be inherited, but prevent the method from being over-ridden?

Yes. Just leave the class public and make the method sealed.

What’s an abstract class?

A class that cannot be instantiated. An abstract class is a class that must be inherited and have the methods overridden. An abstract class is essentially a blueprint for a class without any implementation.

When do you absolutely have to declare a class as abstract?

1. When the class itself is inherited from an abstract class, but not all base abstract methods have been overridden.

2. When at least one of the methods in the class is abstract.

What is an interface class?

Interfaces, like classes, define a set of properties, methods, and events. But unlike classes, interfaces do not provide implementation. They are implemented by classes, and defined as separate entities from classes.

Why can’t you specify the accessibility modifier for methods inside the interface?

They all must be public, and are therefore public by default.

Can you inherit multiple interfaces?

Yes. .NET does support multiple interfaces.

What happens if you inherit multiple interfaces and they have conflicting method names?

It’s up to you to implement the method inside your own class, so implementation is left entirely up to you. This might cause a problem on a higher-level scale if similarly named methods from different interfaces expect different data, but as far as compiler cares you’re okay. To Do: Investigate

What’s the difference between an interface and abstract class?

In an interface class, all methods are abstract - there is no implementation. In an abstract class some methods can be concrete. In an interface class, no accessibility modifiers are allowed. An abstract class may have accessibility modifiers.

What is the difference between a Struct and a Class?

Structs are value-type variables and are thus saved on the stack, additional overhead but faster retrieval. Another difference is that structs cannot inherit.

What’s the implicit name of the parameter that gets passed into the set method/property of a class?

Value. The data type of the value parameter is defined by whatever data type the property is declared as.


What does the keyword “virtual” declare for a method or property?

The method or property can be overridden.


How is method overriding different from method overloading?

When overriding a method, you change the behavior of the method for the derived class. Overloading a method simply involves having another method with the same name within the class.


Can you declare an override method to be static if the original method is not static?

No. The signature of the virtual method must remain the same. (Note: Only the keyword virtual is changed to keyword override)


What are the different ways a method can be overloaded?

Different parameter data types, different number of parameters, different order of parameters.


If a base class has a number of overloaded constructors, and an inheriting class has a number of overloaded constructors; can you enforce a call from an inherited constructor to a specific base constructor?

Yes, just place a colon, and then keyword base (parameter list to invoke the appropriate constructor) in the overloaded constructor definition inside the inherited class.


What’s a delegate?

A delegate object encapsulates a reference to a method.


What’s a multicast delegate?

A delegate that has multiple handlers assigned to it. Each assigned handler (method) is called.

Introduction to Web Forms

Web Forms are an ASP.NET technology that you use to create programmable Web pages. They can present information, using any markup language, to the user in any browser and use code on the server to implement application logic.

Web Forms:
  • Can run on any browser and automatically render the correct, browser-compliant HTML for features such as styles, layout, and so on. Alternatively, you can design your Web form to run on a specific browser such as Microsoft Internet Explorer 5 and take advantage of the features of a rich browser client.
  • Can be programmed in any Common Language Runtime language, including Visual Basic.NET, C#, and Jscript.NET.
  • Are built on the Common Language Runtime and provide all the benefits of those technologies, including a managed execution environment, type safety, inheritance, and dynamic compilation for improved performance.
  • Support WYSIWYG editing tools and powerful RAD development tools, such as Microsoft Visual Studio.NET, for designing and programming your forms.
  • Support a rich set of controls that allows developers to cleanly encapsulate page logic into reusable components and declaratively handle page events.
  • Allow for separation between code and content on a page, eliminating the "spaghetti-code" often found in ASP pages.
  • Provide a set of state management features that preserve the view state of a page between requests.
  • Are extensible with user-created and third-party controls.

Components of Web Forms

Web Forms divide the Web applications user interface into two pieces: the visual component and the user interface logic. If you have worked with rapid application deployment tools, like Microsoft Visual Basic and Microsoft Visual C++, in the past, you will recognize this distinction between the visible portion of a form and the code that interacts with the form.

The user interface for Web Forms pages consists of a file containing markup and Web-Forms–specific elements. This file is referred to as the page. The page works as a container for the text and controls you want to display. Using any HTML editor plus Web Forms Server Controls, you can lay out the form as you like. The page is a file with the extension ".aspx."

User interface logic for the Web form consists of code that you create to interact with the form. You can choose that the programming logic reside in the .aspx file, or in a separate file (referred to as the "code-behind" file), written in Visual Basic or C#. When you run the form, the code-behind class file runs and dynamically produces the output for your page.


What Web Forms Help You Accomplish

Web application programming presents challenges that do not typically arise when programming traditional client-based applications. Among the challenges are these:
  • Rich user interface. A user interface with a large amount of content, a complex layout, and rich user interaction can be difficult and tedious to create and program using basic HTML facilities. It is especially hard to create a rich user interface for applications likely to run in many different browsers.
  • Separation of client and server. In a Web application, the client (browser) and server are different programs often running on different computers (and even on different operating systems). Consequently, the two halves of the application share very little information; they can communicate, but typically only exchange small chunks of simple information.
  • Stateless execution. When a Web server receives a request for a page, it finds the page, processes it, sends it to the browser, and then, effectively, discards all page information. If the user requests the same page again, the server repeats the entire sequence, reprocessing the page from scratch. Put another way, servers have no memory of pages that they have processed. Therefore, if an application needs to maintain information about a page, this becomes a problem that has to be solved in application code.
  • Unknown client capabilities. In many cases, Web applications are accessible to many users using different browsers. Each of these browsers has different capabilities, making it difficult to create an application that will run equally well on all of them.
  • Data access. Reading from and writing to a data source in traditional Web applications can be complicated and resource-intensive.

Meeting these challenges for Web applications can require substantial time and effort. Web Forms address these challenges in the following ways:

Browser-independent applications.
Web Forms provide a framework for creating all application logic on the server, eliminating the need to explicitly code for differences in browsers. However, it still allows you to automatically take advantage of browser-specific features to provide improved performance and a richer client experience.

Event-based programming model.
Web Forms bring to Web applications the model of writing event-handling methods for events that occur in either the client or server. The Web Forms framework abstracts this model in such a way that the underlying mechanism of capturing an event on the client, transmitting it to the server, and calling the appropriate handler is all automatic and invisible. The result is a clear, easily written code structure.

Abstract, intuitive, consistent object model.
The Web Forms framework presents an object model that allows you to think of your forms as a unit, not as separate client and server pieces. In the Web Forms model, you can program the form in a much more intuitive way than in traditional Web applications, including the ability to set properties for form elements and respond to events. In addition, Web Forms controls are an abstraction from the physical contents of an HTML page and from the direct interaction between browser and server. In general, you can use Web Forms controls the way you might work with controls in a client application and not have to think about how to create the HTML to present and process the controls and their contents.

State management.
The Web Forms framework automatically handles the task of maintaining the state of your form and its controls, and provides you with explicit ways to maintain the state of application-specific information. This is accomplished without heavy use of server resources and without sending cookies to the browser, two traditional means for storing state.

Scalable server performance.
The Web Forms framework allows you to scale your application from one computer with a single processor to a multi-computer Web farm cleanly and without complicated changes to the application's logic.

Introduction to ASP.NET

ASP.NET is more than the next version of Active Server Pages (ASP); it is a unified Web development platform that provides the services necessary for developers to build enterprise-class Web applications. While ASP.NET is largely syntax compatible with ASP, it also provides a new programming model and infrastructure that enables a powerful new class of applications. You can feel free to augment your existing ASP applications by incrementally adding ASP.NET functionality to them.

ASP.NET is a compiled .NET-based environment; you can author applications in any .NET compatible language, including Visual Basic, C# and Jscript.NET. Additionally, the entire .NET Framework platform is available to any ASP.NET application. Developers can easily access the benefits of these technologies, which include a managed Common Language Runtime environment, type safety, inheritance, and so on.

ASP.NET has been designed to work seamlessly with WYSIWYG HTML editors and other programming tools, including Microsoft Visual Studio.NET. Not only does this make Web development easier, but it also provides all the benefits that these tools have to offer, including a GUI that developers can use to drop server controls onto a Web page, as well as fully integrated debugging support.

Generally, developers choose from two programming models when creating an ASP.NET application, and combine them in any way they see fit.

  • Web Forms allows you to build powerful forms-based Web pages. When building these pages, you can use Web Forms Controls to create common UI elements and program them for common tasks. These controls allow you to rapidly build up a Web Form out of reusable built-in or custom components, simplifying the code of a page.


  • A Web service is a way to access server functionality remotely. Using services, businesses can expose programmatic interfaces to their data or business logic, which in turn can be obtained and manipulated by client and server applications. Web services enable the exchange of data in client-server or server-server scenarios, using standards like HTTP and XML messaging to move data across firewalls. Web services are not tied to a particular component technology or object-calling convention. As a result, programs written in any language, using any component model, and running on any operating system can access Web services.

Both of these options can take full advantage of all ASP.NET features, as well as the power of the .NET Framework and .NET Framework Common Language Runtime.

  • ASP.NET not only takes advantage of performance enhancements found in the .NET Framework and runtime, it has also been designed to offer significant performance improvements over ASP and other Web development platforms. All ASP.NET code is compiled rather than interpreted, which allows early binding, strong typing, and just-in-time (JIT) compiling to native code, to name only a few of its benefits. ASP.NET is also easily factorable, meaning that developers can remove modules (a session module, for instance) that are not relevant to the application being developed. ASP.NET also provides extensive caching services, both built-in and caching APIs. ASP.NET also ships with Performance Counters that developers and system administrators can monitor to test new applications and gather metrics on existing ones.

  • ASP.NET configuration settings are stored in XML-based files, which are human readable and writable. Each of your applications can have a distinct configuration file and you can extend the configuration scheme to suit your requirements.

  • ASP.NET provides easy-to-use Application and Session state facilities that are familiar to ASP developers and are readily compatible with all other .NET Framework APIs.
    The .NET Framework and ASP.NET provide default authorization and authentication schemes for Web applications. You can easily remove, add to, or replace these schemes depending upon the needs of your application.

  • Accessing databases from ASP.NET applications is an often-used technique for displaying data to Web site visitors. ASP.NET makes it easier than ever to access databases for this purpose - and provides for managing the data in the database.

  • ASP.NET provides a simple framework that enables Web developers to write logic that runs at the application level. Developers can write this code in either the global.asax text file or in a compiled class deployed as an assembly. This logic can include application-level events, but developers can easily extend this framework to suit the needs of their Web application. ASP application code, written in the global.asa file, is completely supported in ASP.NET. You can simply rename global.asa to global.asax when upgrading from ASP.

  • ASP.NET offers complete syntax and processing compatibility with ASP applications. Developers simply need to change file extensions from .asp to .aspx to migrate their files to the ASP.NET framework. They can also easily add ASP.NET functionality to their applications with ease, sometimes by simply adding just a few lines of code to their ASP files.

Microsoft.NET Standardization

Microsoft has secured certification for both C# and CLI from ECMA and ISO/IEC as Industry standards. This is a very important step for Microsoft and .Net platform because this enhances the credibility of the newer .Net platform and allures a larger portion of technology industry into adopting .Net as their development platform. Several companies and government organizations only utilize ISO certified technologies; for example, in Australia anything ISO certified is also considered Australian standard according to the rules of the Australian government. Several academic institutions will now be interested in teaching standard C#. Another major outcome of having an open industry standard specification is .Net platform could be getting ported to other platforms like Linux and UNIX; best example is the Mono Project by Ximian- it is an open source implementation of .Net platform for UNIX and Linux based on ECMA approved Public Domain Specification of C# and CLI. Microsoft submitted the specifications to ECMA, which in turn fast-tracked them through ISO. In doing so, Microsoft released all intellectual property in the core C#/CLI platform to the public domain. No one needs a license to implement C#/CLI. This will also help everybody in better understanding the implementations of C# and CLI which are at the core of .Net platform.

Microsoft has implemented .NET framework for all of its operating system suits (excluding MS Windows 95 and earlier) on all supported hardware platforms. For handheld and small devices, Microsoft has released a compact framework of .NET But, there are various other implementations being developed on platforms other than Microsoft Windows. The most popular implementation, after MS.NET, is the open source ‘Mono’ Project on Linux Microsoft has released almost all the source code of their .NET framework for FreeBSD and Mac OS under the title of Shared Source Common Language Infrastructure (SSCLI).

Difference between traditional development and .NET development

In traditional programming languages, the source code of a program is compiled to a specific platform’s assembly language and then machine language code. Later the library code required by the program is linked to it. Finally the operating system executes the program when desired by the user. The complete process is depicted in the following figure:

In the presence of dot net framework, a program is not compiled to the native machine executable code; rather it gets compiled to an intermediate language code called Microsoft Intermediate Language (MSIL) or Common Intermediate Language (CIL). The Dot Net Common Language Runtime (CLR) then converts this intermediate code at runtime to the machine executable code. The optimization is carried out at runtime. A program also does not call the operating system APIs directly; rather it delegates this task to the CLR which performs the desired operations on behalf of the program and returns the results of the operations back to the program. The CLR also performs the memory management, garbage collection, security and thread management on behalf of the program. Dot NET framework is shipped with the supporting object oriented framework of common code libraries, called the .NET Framework Class Library (FCL), to facilitate the common operations. Hence the .Net manages the overall execution of an application. This is the reason why the code running on .Net framework is sometimes called the managed code. The complete process is depicted in the following Figure. Note that only the CLR (and thus the .Net framework and not the user application) is interacting and coupled with the platform and operating system.

The basic components of .NET platform (framework) are:

Common Language Runtime (CLR):
The most important part of the .NET Framework is the .Net Common Language Runtime (CLR) also called .Net Runtime in short. It is a framework layer that resides above the Operating System and handles/manages the execution of the .NET applications. Our .Net programs don’t directly communicate with the Operating System but through CLR
MSIL (Microsoft Intermediate Language) Code:
When we compile our .Net Program using any .Net compliant language like (C#, VB.NET, C++.NET) it does not get converted into the executable binary code but to an intermediate code, called MSIL or IL in short, understandable by CLR. MSIL is an OS and H/w independent code. When the program needs to be executed, this MSIL or intermediate code is converted to binary executable code, called native code. The presence of IL makes it possible the Cross Language Relationship as all the .Net compliant languages produce the similar standard IL code.
Just In Time Compilers (JITers)
When our IL compiled code needs to be executed, CLR invokes JIT compilers which compile the IL code to native executable code (.exe or .dll) for the specific machine and OS. JITers in many ways are different from traditional compilers as they, as their name suggests, compile the IL to native code only when desired e.g., when a function is called, IL of function’s body is converted to native code; just in time of need. So, the part of code that is not used by particular run is not converted to native code. If some IL code is converted to native code then the next time when its needed to be used, the CLR uses the same copy without re-compiling. So, if a program runs for sometime, then it won’t have any just in time performance penalty. As JITers are aware of processor and OS exactly at runtime, they can optimize the code extremely efficiently resulting in very robust applications. Also, since JITer knows the exact current state of executable code, they can also optimize the code by in-lining small function calls (like replacing body of small function when its called in a loop, saving the function call time). Although, Microsoft stated that C# and .Net are not competing with languages like C++ in efficiency, speed of execution, JITers can make your code even faster than C++ code in some cases when program is run over extended period of time (like web-servers).

Framework Class Library (FCL)
.NET Framework provides huge set of Framework (or Base) Class Library (FCL) for common, usual tasks. FCL contains thousands of classes to provide the access to Windows API and common functions like String Manipulation, Common Data Structures, IO, Streams, Threads, Security, Network Programming, Windows Programming, Web Programming, Data Access, etc. It is simply the largest standard library ever shipped with any development environment or programming language. The best part of this library is they follow extremely efficient OO design (design patterns) making their access and use very simple and predictable. You can use the classes in FCL in your program just as you use any other class and can even apply inheritance and polymorphism on these.
Common Language Specification (CLS)
Earlier we used the term ‘.NET Compliant Language’ and stated that all the .NET compliant languages can make use of CLR and FCL. But what makes a language ‘.NET compliant language’? The answer is Common Language Specification (CLS). Microsoft has released a small set of specification that each language should meet to qualify as a .NET Compliant Language. As IL is a very rich language, it is not necessary for a language to implement all the IL functionality, rather it meets the small subset of it, CLS, to qualify as a .NET compliant language, which is the reason why so many languages (procedural and OO) are now running under .Net umbrella. CLS basically addresses to language design issues and lays certain standards like there should be no global function declaration, no pointers, no multiple inheritance and things like that. The important point to note here is that if you keep your code within CLS boundary, your code is guaranteed to be usable in any other .Net language.
Common Type System (CTS)
.NET also defines a Common Type System (CTS). Like CLS, CTS is also a set of standards. CTS defines the basic data types that IL understands. Each .NET compliant language should map its data types to these standard data types. This makes it possible for the 2 languages to communicate with each other by passing/receiving parameters to/from each other. For example, CTS defines a type Int32, an integral data type of 32 bits (4 bytes) which is mapped by C# through int and VB.Net through its Integer data type.

Garbage Collector (GC)
CLR also contains Garbage Collector (GC) which runs in a low-priority thread and checks for un-referenced dynamically allocated memory space. If it finds some data that is no more referenced by any variable/reference, it re-claims it and returns the occupied memory back to the Operating System; so that it can be used by other programs as necessary. The presence of standard Garbage Collector frees the programmer from keeping track of dangling data.

The software development and execution flow in Microsoft.NET

With .NET development environment, a developer can write his/her code in any .NET compliant programming language like C#, VB.NET, J#, C++.NET, etc. In fact, various modules, components, projects of an application can be written and compiled in different .Net based programming languages. All these components are compiled to the same Intermediate language code (MSIL or CIL) understandable by the .NET CLR.

At runtime, the .NET assembly (compiled IL code) is translated to native machine code and executed by the CLR.

MS.NET compared with Java based platforms (J2EE)
At root level architecture and components, MS.NET and J2EE platforms are very similar. Both are virtual machine based architecture having CLR and Java Virtual Machine (JVM) as the underlying virtual machine for the management and execution of programs. Both provide memory, security and thread management on behalf of the program and both try to decouple the applications with the execution environment (OS and physical machine). Both, basically, target the Web based applications and especially the XML based web services. Both provide managed access to memory and no direct access to memory is allowed to their managed applications.
However, there are few contrasts in the architecture and design of the two virtual machines. Microsoft .NET framework’s architecture is more coupled to the Microsoft Windows Operating System which makes it difficult to implement it on various operating systems and physical machines. Java, on the other hand, is available on almost all major platforms. At the darker side, J2EE architecture and JVM is more coupled to the Java programming language while Microsoft.NET has been designed from the scratch to support language independence and language integration. Microsoft.NET covers the component development and integration in much more detail than Java. The versioning policy of .NET is simply the best implemented versioning solution in the software development history. Java has got the support of industry giants like Sun, IBM, Apache and Oracle while the Microsoft.NET is supported by giants like Microsoft, Intel, and HP.

MS.NET for software development

Well, most of the software development all over the world is done on and for Microsoft Windows Operating System. Dot Net is now the standard software development environment for the Microsoft Windows operating system. It dramatically simplifies the development of windows, web based, data access applications, components, controls and web services. Dot net comes with amazing features like XML configuration, reflection, and attributes to ease the overall software development life cycle. Finally, the dot net is supported by the Microsoft Visual Studio Integrated Development Environment; the best IDE available for any software development environment. Visual Studio .NET (VS.NET) supports all the areas of software development from project creation to debugging and installation.
Shortcomings of MS.NET platform

The foremost short coming of .NET platform is that it is still the propriety of Microsoft. It is more coupled with the Microsoft Windows operating system and is implemented only on Microsoft Windows successfully. MS.NET desktop applications can run only on Microsoft Windows, Web based applications and web services can only be deployed on Microsoft Internet Information Server (IIS). Since, dot net framework contains a lot of utilities, components, and framework class libraries, the size of downloadable framework is quite large (25MB compared to 5MB size of JVM). Not all types of applications can be written in .NET managed applications, for example, you can’t write CLR or Operating System in your managed applications. The managed .Net applications are somewhat slower to start and run than the traditional Win32 applications. The compiled code of .Net managed applications is easier to de-compile back to the source code.
How true it is that .NET and Java programs are quite in-efficient when compared to C++

The startup of managed .NET and Java programs is definitely slower than the traditional C++ programs as it involves the hosting of CLR into managed application process in .NET and starting the JVM in a new process in case of Java. The execution also is a bit slower during the initial period of program execution as the intermediate code is translated to the machine code on the fly at runtime. But as the program runs various parts repeatedly, the execution gets pace too. Since, the CLR and JVM optimizes the code more efficiently than the static C++ compilers, the execution speed of the program may actually be faster after sometime of the program startup when most of the code is translated. Hence, in the longer run, the .Net and Java based programs should not be in-efficient when compared to C++. We used ‘should’ here as the actual performance depends on the particular implementation and implementation strategy.

Using COM components in .NET

The .NET does not encourage the use of COM component directly inside the managed application! Although, the .NET framework contains utilities that enable COM components to be used inside the .Net applications seamlessly. How it is done? The .NET utilities like TlbImp generates the wrapper .NET assembly for the COM component which provides the same calling interface to the client as exposed by the COM component. Inside the wrapper methods, it calls the actual methods of the COM component and returns the result back to the caller. The generated wrapper .NET assembly is called the ‘Runtime Callable Wrapper’ or RCW.
To use a COM component in your Visual Studio.NET project, you need to add a reference of the COM component in the Reference node of the project node of the solution inside the solution explorer window. The great thing about Visual Studio.Net is that it allows you to add a reference to the COM component in exactly the similar way as you add the reference to the .NET assembly. The Visual Studio.NET automatically creates the runtime callable wrapper assembly for the referenced COM component.

To add a reference to a COM component, right click the ‘Reference’ node under the project node inside the solution explorer and select the ‘Add Reference…’ option. It will show you a user interface screen where you browse for the target COM component. When you have selected the component, press the ‘Select’ button and then press OK. This will add a new reference node in the Reference sub tree of the project. By selecting the added reference node, you can edit its properties from the properties window.

The process of importing a COM component into .NET is called ‘COM interoperability with .NET’

Difference between ASP and ASP.NET

Web application development in .NET with ASP.NET has evolved a great deal. The overall architecture of web applications in .Net is much more improved and robust. The enhanced features in ASP.NET make it the best available technology for web application development. The code behind the ASP.Net scripts can be in written in any .Net compliant programming language.

The script (ASP.NET scripts), logic (code behind) and presentation (view) are separated from each other so they may evolve independently. There are much more server controls now available in .Net including the standard calendar and amazingly useful data grid controls. The ASP.Net web applications can now use .NET assemblies and COM components to serve the client requests. ASP.NET pages are now compiled contrary to the ASP pages which are interpreted by the ISA server. Truly speaking, there is no comparison between ASP and ASP.NET... ASP.NET simply rules!

Console, Windows, Web applications and Web services

Console applications are light weight programs run inside the command prompt (DOS) window. They are commonly used for test applications.
Windows Applications are form based standard Windows desktop applications for common day to day tasks. Microsoft word is an example of a Windows application.

Web applications are programs that used to run inside some web server (e.g., IIS) to fulfill the user requests over the http. A typical example of web application is Hotmail and Google.

Web services are web applications that provide services to other applications over the internet. Google search engine’s web service, e.g., allows other applications to delegate the task of searching over the internet to Google web service and use the result produced by it in their own applications.

VB.NET and C# Comparison

VB.NET and C# both are integral part of the .NET framework. Both of the languages have a lot of similarities in language constructs and language design with minor differences in the syntax. C# is more like C++ and Java in its syntax while VB.NET lends its syntax from VB6 a great deal; although VB.NET can not be seen as the successor of Visual Basic at the level of overall language design and the vision of its creators.

The general conception is that most of the VB6 developers will upgrade to VB.NET while developers coming from Java or C++ to .NET are likely to go for C#. Since web developers for Windows using ASP are familiar with VB and VB Scripts, therefore, most of the web development with ASP.NET at the start is likely to be dominated by VB.NET; but after sometime C# will be able to attract at least half of these developers. Keeping technical side away, C++ and thus C# developers are generally paid more than those of VB developers. So, this might also be the factor for making C# the language of choice on .NET framework.