Tuesday, June 23, 2009

New Features in C# 3.0

Almost two years ago — before Visual Studio 2005 and C# 2.0 even shipped — Microsoft announced features that would be in C# 3.0. In May of 2006, they released a preview version of Visual Studio, called "Orcas," which contained early versions of C# 3.0, some Visual Basic language enhancements, and other new features. Microsoft also released the C# 3.0 Language Specification, which details the new language features.

The stated intent of the new language features is "to support the creation and use of higher-order, functional-style class libraries." To that end, the following features are introduced:

  • Implicitly typed local variables.
  • Object initializers.
  • Collection initializers.
  • Anonymous types.
  • Implicitly typed arrays.
  • Extension methods.
  • Lambda expressions.
  • Query expressions.
  • Expression trees.



New features in ASP.NET 3.5


Microsoft released ASP.NET 3.5. ASP.NET 3.5 uses the same engine as that of ASP.NET 2.0, with some extra features added on top of it. Here I m going to light on new features, I think it will be very needful to everyone.

1.ASP.NET AJAX

In ASP.NET 2.0, ASP.NET AJAX was used as an extension to it. You had to download the extensions and install it. However in ASP.NET 3.5, ASP.NET AJAX is integrated into the .NET Framework, thereby making the process of building cool user interfaces easier and intuitive.

2.New Controls

ListView:

The ListView control is quiet flexible and contains features of the Gridview, Datagrid, Repeater and similar list controls available in ASP.NET 2.0. It provides the ability to insert, delete, page (using Data Pager), sort and edit data.
DataPager:

DataPager provides paging support to the ListView control. DataPager gives you a consistent way of paging with the controls that support it.

3.LINQ

LINQ (Language Integrated Query) adds native data querying capability to C# and VB.NET along with the compiler and Intellisense support.

4.ASP.NET Merge Tool

ASP.NET 3.5 includes a new merge tool (aspnet_merge.exe). This tool lets you combine and manage assemblies created by aspnet_compiler.exe. This tool was available earlier as an add-on.

5.New Assemblies

System.Core.dll
System.Data.Linq.dll
System.Xml.Linq.dll
System.Data.DataSetExtensions.dll
System.Web.Extensions.dll


ASP.NET 2.0 - New Features

ASP.NET 2.0 improves ASP.NET by adding several new features.


Improvements in ASP.NET 2.0

ASP.NET 2.0 was designed to make web development easier and quicker.

Design goals for ASP.NET 2.0:

  • Increase productivity by removing 70% of the code
  • Use the same controls for all types of devices
  • Provide a faster and better web server platform
  • Simplify compilation and installation
  • Simplify the administration of web applications

What's New in ASP.NET 2.0?

Some of the new features in ASP.NET 2.0 are:

  • Master Pages, Themes, and Web Parts
  • Standard controls for navigation
  • Standard controls for security
  • Roles, personalization, and internationalization services
  • Improved and simplified data access controls
  • Full support for XML standards like, XHTML, XML, and WSDL
  • Improved compilation and deployment (installation)
  • Improved site management
  • New and improved development tools

The new features are described below.


Master Pages

ASP.NET didn't have a method for applying a consistent look and feel for a whole web site.

Master pages in ASP.NET 2.0 solves this problem.

A master page is a template for other pages, with shared layout and functionality. The master page defines placeholders for content pages. The result page is a combination (merge) of the master page and the content page.

Read more about master pages.


Themes

Themes is another feature of ASP.NET 2.0. Themes, or skins, allow developers to create a customized look for web applications.

Design goals for ASP.NET 2.0 themes:

  • Make it simple to customize the appearance of a site
  • Allow themes to be applied to controls, pages, and entire sites
  • Allow all visual elements to be customized

Web Parts

ASP.NET 2.0 Web Parts can provide a consistent look for a site, while still allowing user customization of style and content.

New controls:

  • Zone controls - areas on a page where the content is consistent
  • Web part controls - content areas for each zone

Navigation

ASP.NET 2.0 has built-in navigation controls like

  • Site Maps
  • Dynamic HTML menus
  • Tree Views

Security

Security is very important for protecting confidential and personal information.

In ASP.NET 2.0 the following controls has been added:

  • A Login control, which provides login functionality
  • A LoginStatus control, to control the login status
  • A LoginName control to display the current user name
  • A LoginView control, to provide different views depending on login status
  • A CreateUser wizard, to allow creation of user accounts
  • A PasswordRecovery control, to provide the "I forgot my password" functionality

Roles and Personalization

Internet communities are growing very popular.

ASP.NET 2.0 has personalization features for storing user details. This provides an easy way to customize user (and user group) properties.


Internationalization

Reaching people with different languages is important if you want to reach a larger audience.

ASP.NET 2.0 has improved support for multiple languages.


Data Access

Many web sites are data driven, using databases or XML files as data sources.

With ASP.NET this involved code, and often the same code had to be used over and over in different web pages.

A key goal of ASP.NET 2.0 was to ease the use of data sources.

ASP.NET 2.0 has new data controls, removing much of the need for programming and in-depth knowledge of data connections.


Mobility Support

The problem with Mobile devices is screen size and display capabilities.

In ASP.NET, the Microsoft Mobile Internet Toolkit (MMIT) provided this support.

In ASP.NET 2.0, MMIT is no longer needed because mobile support is built into all controls.


Images

ASP.NET 2.0 has new controls for handling images:

  • The ImageMap control - image map support
  • The DynamicImage control - image support for different browsers

These controls are important for better image display on mobile devices, like hand-held computers and cell phones.


Automatic Compilation

ASP.NET 2.0 provides automatic compilation. All files within a directory will be compiled on the first run, including support for WSDL, and XSD files.


Compiled Deployment (Installation) and Source Protection

ASP.NET 2.0 also provides pre-compilation. An entire web site can be pre-compiled. This provides an easy way to deploy (upload to a server) compiled applications, and because only compiled files are deployed, the source code is protected.


Site Management

ASP.NET 2.0 has three new features for web site configuration and management:

  • New local management console
  • New programmable management functions (API)
  • New web-based management tool

Development Tools

With ASP.NET Visual Studio.NET was released with project and design features targeted at corporate developers.

With ASP.NET 2.0, Visual Studio 2005 was released.

Key design features for Visual Studio 2005 include:

  • Support for the features described above
  • Upload files from anywhere (FTP, File System, Front Page....)
  • No project files, allowing code to be manipulated outside Visual Studio
  • Integrated Web Site Administration Tool
  • No "build" step - ability to compile on first run

Visual Web Developer is a new free ASP.NET 2.0 tool for non-corporate developers who don't have access to Visual Studio.NET.

HTML DOM :

What is the HTML DOM?

The HTML DOM is:

  • A Document Object Model for HTML
  • A standard programming interface for HTML
  • Platform- and language-independent
  • A W3C standard

The HTML DOM defines the objects and properties of all HTML elements, and the methods (interface) to access them.

In other words: The HTML DOM is a standard for how to get, change, add, or delete HTML elements.




Define DHTML :

DHTML is NOT a Language

DHTML stands for Dynamic HTML.

DHTML is NOT a language or a web standard.

DHTML is a TERM used to describe the technologies used to make web pages dynamic and interactive.

To most people DHTML means the combination of HTML, JavaScript, DOM, and CSS.

According to the World Wide Web Consortium (W3C):
"Dynamic HTML is a term used by some vendors to describe the combination of HTML, style sheets and scripts that allows documents to be animated.

DHTML Technologies

Below is a listing of DHTML technologies.

HTML 4

The W3C HTML 4 standard has rich support for dynamic content:

  • HTML supports JavaScript
  • HTML supports the Document Object Model (DOM)
  • HTML supports HTML Events
  • HTML supports Cascading Style Sheets (CSS)

DHTML is about using these features to create dynamic and interactive web pages.

JavaScript

JavaScript is the scripting standard for HTML.

DHTML is about using JavaScript to control, access and manipulate HTML elements.

You can read more about this in the next chapter of this tutorial.

HTML DOM

The HTML DOM is the W3C standard Document Object Model for HTML.

The HTML DOM defines a standard set of objects for HTML, and a standard way to access and manipulate them.

DHTML is about using the DOM to access and manipulate HTML elements.

You can read more about this in a later chapter of this tutorial.

HTML Events

The W3C HTML Event Model is a part of the HTML DOM.

It defines a standard way to handle HTML events.

DHTML is about creating web pages that reacts to (user)events.

You can read more about this in a later chapter of this tutorial.

CSS

CSS is the W3C standard style and layout model for HTML.

CSS allows web developers to control the style and layout of web pages.

HTML 4 allows dynamic changes to CSS.

DHTML is about using JavaScript and DOM to change the style and positioning of HTML elements.

You can read more about this in a later chapter of this tutorial.


Define XML :

What is XML?

  • XML stands for EXtensible Markup Language
  • XML is a markup language much like HTML
  • XML was designed to carry data, not to display data
  • XML tags are not predefined. You must define your own tags
  • XML is designed to be self-descriptive
  • XML is a W3C Recommendation
The Difference Between XML and HTML

XML is not a replacement for HTML.

XML and HTML were designed with different goals:

  • XML was designed to transport and store data, with focus on what data is.
  • HTML was designed to display data, with focus on how data looks.

HTML is about displaying information, while XML is about carrying information.

XML is Just Plain Text

XML is nothing special. It is just plain text. Software that can handle plain text can also handle XML.

However, XML-aware applications can handle the XML tags specially. The functional meaning of the tags depends on the nature of the application.

Monday, June 22, 2009

Different Between SQL Server 2000 and 2005.

Feature

SQL Server 2000

Security:Owner = Schema, hard to remove old users at times

Encryption:No options built in, expensive third party options with proprietary skills required to implement properly.

High Availability Clustering or Log Shipping require Enterprise Edition. Expensive hardware.

Scalability:Limited to 2GB, 4CPUs in Standard Edition. Limited 64-bit support.

SQL Server 2005

Security Schema is separate. Better granularity in easily controlling security. Logins can be authenticated by certificates.

Encryption Encryption and key management build in.

High Availability Clustering, Database Mirroring or Log Shipping available in Standard Edition. Database Mirroring can use cheap hardware.

Scalability 4 CPU, no RAM limit in Standard Edition. More 64-bit options offer chances for consolidation.

Differences :

1. In SQL Server 2000 the Query Analyzer and Enterprise Manager are seperate,whereas in SQL Server 2005 both were combined as Management Studio.

2. In Sql 2005,the new datatype XML is used,whereas in Sql 2000 there is no such datatype

3. In Sql server2000 we can create 65,535 databases,whereas in Sql server2005 2(pow(20))-1 databases can be created.


1 UI Differences -Tools Analysis Services Manager (ASM)
Query Analyzer (QA)
Enterprise Manager (EM)
Report Manager
Business Intelligence Development Studio (BIDS)
SQL Server Management Studio (SSMS)

2 UI Differences -Organizing Grain
ASM "Database" BIDS "Solution"and "Project"

3 UI Differences - Data Modeling Must be connected to do anything
Single Data Source, Single Fact Table per Cube
Cannot directly rename entities -must resort to database views to rename entities and for logical abstraction
Must resort to virtual cubes for mixed fact granularity
No support for arbitrary SQL as a Data Source
Data Source Views (DSVs) provide an abstraction layer
Between Database and Cubes, DSV can contain tables drawn from multiple heterogeneous
In data source , once DSV established, need not be connected to work with cube models
Can rename entities, provide annotations
Named Queries -arbitrary SQL as Data Source
DSVs can be shared between cubes and DTS for improved consistency and administration

4 UI Differences -Cube Construction Manually intensive, even with Wizard
Must know the underlying schema well
Intellicube

5 UI Differences -Deployment Archive/Restore Database
CAB files
No configuration variables for Data Source connectivity, etc.
Elaborate Configuration and Deployment Model

6 UI Differences - Metadata Storage
There isa repository
Defaults to Access -can upgrade to SQL Server
Cannot really be source-controlled
There is not a repository
Metadata stored in XML documents, can easily be source-controlled
Team development is facilitated

7 Architecture -Unified Dimensional Model
Distinct difference between flat file, relational, cube and web-service data sources
Unified Dimensional Model (UDM) integrates all types of data sources -data consumer sees single, multi-dimensional interface
Allows the user model to be greatly enriched
Provides high performance queries supporting interactive analysis, even over huge data volumes
Allows business rules to be captured in the model to support richer analysis
Supports writeback and 'closing the loop'

8 Architecture –Dimensions
Role-playing requires multiple Dimensions
Role-playing is a new Dimension type
Reference Dimension
Many-to-many Dimension

9 Architecture –Hierarchies One and only one Hierarchy per Dimension
Attributes are either part of Hierarchy or are Properties
Zero to multiple Hierarchies in same Dimension

Wednesday, June 17, 2009

What is the difference between Web Services and Remoting?

Both Remoting and Web Services are ways of communication between applications.

Remoting - In remoting, the applications involved in the communication process may be located on the same computer, different computers in a same or different network. In remoting, both applications know about each other. A proxy of an application object is created on the other application.

Web Services - Communication between applications using web services is platform independent and programming independent. The application that consumes the web service, simply accesses it, without needing to know how this web service has actually been implemented & created.

Here are some of the major differences:
* ASP.NET Web Services may be accessed using HTTP only. Remoting objects may be accessed over any protocol like TCP, SMTP, HTTP
* Web Service are Stateless, whereas Remoting has support for both stateless and with-state environment, which is achieved using Singleton and Singlecall activation
* ASP.NET provides good support to create Web Services. They are easy to deploy. In comparison, Remoting is little complex.
* Web services may be considered very reliable, due to the fact that they are hosted on IIS. In remoting, if IIS is'nt used, then methods like plumbing have to be used to ensure the application reliability.
* In .NET, when we create an application that consumes a web service, the web service may or may not be built using .NET. But while implementing Remoting in .NET, both the applications must be built in .NET.
* Using web services, only a limited number of types may be serialized (XML). Using Remoting, objects like SOAP objects, Binary objects & XML Objects may be serialized.

Notes:
Use Remoting for more efficient exchange of information when you control both ends of the application. Use Web services for open-protocol-based information exchange when you are just a client or a server with the other end belonging to someone else.

Dot Net : Interview Question Part 2

1. What�s an interface class?
It�s an abstract class with public abstract methods all of which must be implemented in the inherited classes.

2. Why can�t you specify the accessibility modifier for methods inside the interface?
They all must be public. Therefore, to prevent you from getting the false impression that you have any freedom of choice, you are not allowed to specify any accessibility, it�s public by default.

3. Can you inherit multiple interfaces?
Yes

4. What�s the difference between an interface and abstract class?
In the interface all methods must be abstract; in the abstract class some methods can be concrete. In the interface no accessibility modifiers are allowed, which is ok in abstract classes.

5. How can you overload a method?
Different parameter data types, different number of parameters, different order of parameters.

6. If a base class has a bunch of overloaded constructors, and an inherited class has another bunch of overloaded constructors, can you enforce a call from an inherited constructor to an arbitrary 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.

7. What�s the difference between System.String and System.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.

8. What�s the advantage of using System.Text.StringBuilder over System.String?
StringBuilder is more efficient in the cases, where a lot of manipulation is done to the text. Strings are immutable, so each time it�s being operated on, a new instance is created.

9. Can you store multiple data types in System.Array?
If the Array is System.Object Type then the answer is Yes else No.

10. What�s the difference between the System.Array.CopyTo() and System.Array.Clone()?
The first one performs a deep copy of the array, the second one is shallow.

11. How can you sort the elements of the array in descending order?
By calling Sort() and then Reverse() methods.

12. What�s the .NET datatype that allows the retrieval of data by a unique key?
HashTable.

13. What�s class SortedList underneath?
A sorted HashTable.

14. Will finally block get executed if the exception had not occurred?
Yes.

15. What�s the C# equivalent of C++ catch (�), which was a catch-all statement for 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 {}.

16. Can multiple catch blocks be executed?
No, once the proper catch code fires off, the control is transferred to the finally block (if there are any), and then whatever follows the finally block.

17. What�s a delegate?
A delegate object encapsulates a reference to a method. In C++ they were referred to as function pointers.

18. What�s a multicast delegate?
It�s a delegate that points to and eventually fires off several methods.

19. How�s the DLL Hell problem solved in .NET?
Assembly versioning allows the application to specify not only the library it needs to run (which was available under Win32), but also the version of the assembly.

20. What are the ways to deploy an assembly?
An MSI installer, a CAB archive, and XCOPY command.

21. What namespaces are necessary to create a localized application?
System.Globalization, System.Resources.

22. What�s the difference between // comments, /* */ comments and /// comments?
Single-line, multi-line and XML documentation comments.

23. How do you generate documentation from the C# file commented properly with a command-line compiler?
Compile it with a /doc switch.

24. What�s the difference between and XML documentation tag?
Single line code example and multiple-line code example.

25. Is XML case-sensitive?
Yes, so and are different elements.

26. What debugging tools come with the .NET SDK?
CorDBG � command-line debugger, and DbgCLR � graphic debugger. Visual Studio .NET uses the DbgCLR. To use CorDbg, you must compile the original C# file using the /debug switch.

27. What does assert() do?
In debug compilation, assert takes in a Boolean condition as a parameter, and shows the error dialog if the condition is false. The program proceeds without any interruption if the condition is true.

28. What�s the difference between the Debug class and Trace class?
Documentation looks the same. Use Debug class for debug builds, use Trace class for both debug and release builds.

29. Why are there five tracing levels in System.Diagnostics.TraceSwitcher?
The tracing dumps can be quite verbose and for some applications that are constantly running you run the risk of overloading the machine and the hard drive there. Five levels range from None to Verbose, allowing to fine-tune the tracing activities.

30. Where is the output of TextWriterTraceListener redirected?
To the Console or a text file depending on the parameter passed to the constructor.

31. How do you debug an ASP.NET Web application?
Attach the aspnet_wp.exe process to the DbgClr debugger.

32. What are three test cases you should go through in unit testing?
Positive test cases (correct data, correct output), negative test cases (broken or missing data, proper handling), exception test cases (exceptions are thrown and caught properly).

33. Can you change the value of a variable while debugging a C# application?
Yes, if you are debugging via Visual Studio.NET, just go to Immediate window.

34. Explain the three services model (three-tier application).
Presentation (UI), business (logic and underlying code) and data (from storage or other sources).

35. What are advantages and disadvantages of Microsoft-provided data provider classes in ADO.NET?
SQLServer.NET data provider is high-speed and robust, but requires SQL Server license purchased from Microsoft. OLE-DB.NET is universal for accessing other sources, like Oracle, DB2, Microsoft Access and Informix, but it�s a .NET layer on top of OLE layer, so not the fastest thing in the world. ODBC.NET is a deprecated layer provided for backward compatibility to ODBC engines.

36. What�s the role of the DataReader class in ADO.NET connections?
It returns a read-only dataset from the data source when the command is executed.

38. What does Dispose method do with the connection object?
Deletes it from the memory.

39. What is a pre-requisite for connection pooling?
Multiple processes must agree that they will share the same connection, where every parameter is the same, including the security settings.

40. Can you write a class without specifying namespace? Which namespace does it belong to by default??
Yes, then the class belongs to global namespace which has no name. For commercial products, naturally, you wouldn�t want global namespace.

41. What is Viewstate :
View state is used automatically by the ASP.NET page framework to persist information that must be preserved between postbacks. This information includes any non-default values of controls.
You can also use view state to store application data that is specific to a page.

Dot Net : Interview Question Part 1

1. What is CLR?
The .NET Framework provides a runtime environment called the Common Language Runtime or CLR (similar to the Java Virtual Machine or JVM in Java), which handles the execution of code and provides useful services for the implementation of the program. CLR takes care of code management at program execution and provides various beneficial services such as memory management, thread management, security management, code verification, compilation, and other system services. The managed code that targets CLR benefits from useful features such as cross-language integration, cross-language exception handling, versioning, enhanced security, deployment support, and debugging.

2. What is CTS?
Common Type System (CTS) describes how types are declared, used and managed in the runtime and facilitates cross-language integration, type safety, and high performance code execution.

3. What is CLS?
The CLS is simply a specification that defines the rules to support language integration in such a way that programs written in any language, yet can interoperate with one another, taking full advantage of inheritance, polymorphism, exceptions, and other features. These rules and the specification are documented in the ECMA proposed standard document, "Partition I Architecture"

4. What is CLI?
The CLI is a set of specifications for a runtime environment, including a common type system, base class library, and a machine-independent intermediate code known as the Common Intermediate Language (CIL). (Source: Wikipedia.)

5. Explain Namespace.
Namespaces are logical groupings of names used within a program. There may be multiple namespaces in a single application code, grouped based on the identifiers� use. The name of any given identifier must appear only once in its namespace.

6. Explain Assembly and Manifest.
An assembly is a collection of one or more files and one of them (DLL or EXE) contains a special metadata called Assembly Manifest. The manifest is stored as binary data and contains details like versioning requirements for the assembly, the author, security permissions, and list of files forming the assembly. An assembly is created whenever a DLL is built. The manifest can be viewed programmatically by making use of classes from the System.Reflection namespace. The tool Intermediate Language Disassembler (ILDASM) can be used for this purpose. It can be launched from the command prompt or via Start> Run.

7. What is Shadow Copy?
In order to replace a COM component on a live web server, it was necessary to stop the entire website, copy the new files and then restart the website. This is not feasible for the web servers that need to be always running. .NET components are different. They can be overwritten at any time using a mechanism called Shadow Copy. It prevents the Portable Executable (PE) files like DLLs and EXEs from being locked. Whenever new versions of the PEs are released, they are automatically detected by the CLR and the changed components will be automatically loaded. They will be used to process all new requests not currently executing, while the older version still runs the currently executing requests. By bleeding out the older version, the update is completed.

8. What is DLL Hell?
DLL hell is the problem that occurs when an installation of a newer application might break or hinder other applications as newer DLLs are copied into the system and the older applications do not support or are not compatible with them. .NET overcomes this problem by supporting multiple versions of an assembly at any given time. This is also called side-by-side component versioning.

9. Explain Web Services.
Web services are programmable business logic components that provide access to functionality through the Internet. Standard protocols like HTTP can be used to access them. Web services are based on the Simple Object Access Protocol (SOAP), which is an application of XML. Web services are given the .asmx extension.

10. Explain Windows Forms.
Windows Forms is employed for developing Windows GUI applications. It is a class library that gives developers access to Windows Common Controls with rich functionality. It is a common GUI library for all the languages supported by the .NET Framework.

11. Define Boxing and UnBoxing
C# provides us with Value types and Reference Types. Value Types are stored on the stack and Reference types are stored on the heap. The conversion of value type to reference type is known as boxing and converting reference type back to the value type is known as unboxing.

12. Define Value Types and Reference Types
Value Types Value types are primitive types that are mapped directly to the FCL. 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. Reference TypesReference Types are different from value types in such a way that memory is allocated to them from the heap. All the classes are of reference type. C# new operator returns the memory address of the object.

13. What are Service Oriented Architectures (SOA)?
SOA describes an information technology architecture that enables distributed computing environments with many different types of computing platforms and applications. Web services are one of the technologies that help make SOAs possible. As a concept, SOA has been around since the 1980s, but many early IT technologies failed to achieve the goal of linking different types of applications and systems. By making early investments with .NET, Microsoft has helped provide the building blocks that today are putting many enterprise customers on the path to successfully implementing SOAs. With SOAs, companies can benefit from the unimpeded flow of information that is the hallmark of connected systems.

14. What are Web Services Enhancements for Microsoft .NET (WSE)?
WSE is an add-on to Microsoft Visual Studio .NET and the Microsoft .NET Framework that helps developers build greater security features into Web services using the latest Web services protocol specifications and standards. With WSE 2.0 developers can create security-enhanced connected systems that help improve business processes within�and beyond�corporate trust boundaries and create new revenue-generating opportunities.

15. What is a Smart Client?
Smart clients are client applications that consume Web services and reside on user hardware such as desktop PCs, laptops, Pocket PCs, and Smartphones. They are easily deployed and managed and provide an adaptive, responsive, and rich interactive experience by taking advantage of the computing resources on the device and intelligently connecting to distributed data sources.

16. What is .NET Passport?
.NET Passport is a Web-based service that is designed to make signing in to Web sites fast and easy. Passport enables participating sites to authenticate a user with a single set of sign-in credentials, alleviating the need for users to remember numerous passwords and user names.

17. Does C# support multiple inheritance?
No, use interfaces instead

18. What�s the implicit name of the parameter that gets passed into the class� set method?
Value, and its datatype depends on whatever variable we�re changing

19. What�s the top .NET class that everything is derived from?
System.Object.

20. How�s method overriding different from overloading?
When overriding, you change the method behavior for a derived class. Overloading simply involves having a method with the same name within the class.

21. What is strong name?
A name that consists of an assembly's identity�its simple text name, version number, and culture information (if provided)�strengthened by a public key and a digital signature generated over the assembly.

22. What is Application Domain?
The primary purpose of the AppDomain is to isolate an application from other applications. Win32 processes provide isolation by having distinct memory address spaces. This is effective, but it is expensive and doesn't scale well. The .NET runtime enforces AppDomain isolation by keeping control over the use of memory - all memory in the AppDomain is managed by the .NET runtime, so the runtime can ensure that AppDomains do not access each other's memory. Objects in different application domains communicate either by transporting copies of objects across application domain boundaries, or by using a proxy to exchange messages.

23. What is serialization in .NET? What are the ways to control serialization?
Serialization is the process of converting an object into a stream of bytes. Deserialization is the opposite process of creating an object from a stream of bytes. Serialization/Deserialization is mostly used to transport objects (e.g. during remoting), or to persist objects (e.g. to a file or database).Serialization can be defined as the process of storing the state of an object to a storage medium. During this process, the public and private fields of the object and the name of the class, including the assembly containing the class, are converted to a stream of bytes, which is then written to a data stream. When the object is subsequently deserialized, an exact clone of the original object is created. Binary serialization preserves type fidelity, which is useful for preserving the state of an object between different invocations of an application. For example, you can share an object between different applications by serializing it to the clipboard. You can serialize an object to a stream, disk, memory, over the network, and so forth. Remoting uses serialization to pass objects "by value" from one computer or application domain to another. XML serialization serializes only public properties and fields and does not preserve type fidelity. This is useful when you want to provide or consume data without restricting the application that uses the data. Because XML is an open standard, it is an attractive choice for sharing data across the Web. SOAP is an open standard, which makes it an attractive choice. There are two separate mechanisms provided by the .NET class library - XmlSerializer and SoapFormatter/BinaryFormatter. Microsoft uses XmlSerializer for Web Services, and uses SoapFormatter/BinaryFormatter for remoting. Both are available for use in your own code.

24. What�s an interface class?
It�s an abstract class with public abstract methods all of which must be implemented in the inherited classes

25. What is the transport protocol you use to call a Web service
SOAP is the preferred protocol

26. What are Satellite Assemblies?
Satellite assemblies are often used to deploy language-specific resources for an application. These language-specific assemblies work in side-by-side execution because the application has a separate product ID for each language and installs satellite assemblies in a language-specific subdirectory for each language. When uninstalling, the application removes only the satellite assemblies associated with a given language and .NET Framework version. No core .NET Framework files are removed unless the last language for that .NET Framework version is being removed.

27. 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.

28. What is Reflection in .NET?
All .NET compilers produce metadata about the types defined in the modules they produce. This metadata is packaged along with the module (modules in turn are packaged together in assemblies), and can be accessed by a mechanism called reflection. The System.Reflection namespace contains classes that can be used to interrogate the types for a module/assembly.

29. What is the managed and unmanaged code in .net?
The .NET Framework provides a run-time environment called the Common Language Runtime, which manages the execution of code and provides services that make the development process easier. Compilers and tools expose the runtime's functionality and enable you to write code that benefits from this managed execution environment. Code that you develop with a language compiler that targets the runtime is called managed code; it benefits from features such as cross-language integration, cross-language exception handling, enhanced security, versioning and deployment support, a simplified model for component interaction, and debugging and profiling services

30. What are the access-specifiers available in c#?
Private, Protected, Public, Internal, Protected Internal.

31. Difference between OLEDB Provider and SqlClient ?
SQLClient .NET classes are highly optimized for the .net / sqlserver combination and achieve optimal results. The SqlClient data provider is fast. It's faster than the Oracle provider, and faster than accessing database via the OleDb layer. It's faster because it accesses the native library (which automatically gives you better performance), and it was written with lots of help from the SQL Server team.

32. Differences between dataset.clone and dataset.copy?
Clone - Copies the structure of the DataSet, including all DataTable schemas, relations, and constraints.Does not copy any data . Copy - Copies both the structure and data for this DataSet.

33. In a Webservice, need to display 10 rows from a table. So DataReader or DataSet is best choice?
WebService will support only DataSet.

34. What is Remoting?
The process of communication between different operating system processes, regardless of whether they are on the same computer. The .NET remoting system is an architecture designed to simplify communication between objects living in different application domains, whether on the same computer or not, and between different contexts, whether in the same application domain or not.

35. What�s the difference between System.String and System.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.

36. What�s a delegate?
A delegate object encapsulates a reference to a method. In C++ they were referred to as function pointers.

37. What�s the implicit name of the parameter that gets passed into the class� set method?
Value, and its datatype depends on whatever variable we�re changing.

38. How do you inherit from a class in C#?
Place a colon and then the name of the base class. Notice that it�s double colon in C++.

39. Does C# support multiple inheritance?
No, use interfaces instead.

40. When you inherit a protected class-level variable, who is it available to?
Classes in the same namespace.

41. Are private class-level variables inherited?
Yes, but they are not accessible, so looking at it you can honestly say that they are not inherited. But they are.

42. Describe the accessibility modifier protected internal.
It�s available to derived classes and classes within the same Assembly (and naturally from the base class it�s declared in).

43. C# provides a default constructor for me. I write a constructor that takes a string as a parameter, but want to keep the no parameter one. How many constructors should I write?
Two. Once you write at least one constructor, C# cancels the freebie constructor, and now you have to write one yourself, even if there�s no implementation in it.

44. How�s method overriding different from overloading?
When overriding, you change the method behavior for a derived class. Overloading simply involves having a method with the same name within the class.

45. What does the keyword virtual mean in the method definition?
The method can be over-ridden.

46. Can you declare the override method static while the original method is non-static?
No, you can�t, the signature of the virtual method must remain the same, only the keyword virtual is changed to keyword override.

47. Can you override private virtual methods?
No, moreover, you cannot access private methods in inherited classes, have to be protected in the base class to allow any sort of access.

48. Can you prevent your class from being inherited and becoming a base class for some other classes?
Yes, that�s what keyword sealed in the class definition is for. The developer trying to derive from your class will get a message: cannot inherit from Sealed class WhateverBaseClassName. It�s the same concept as final class in Java.

49. Can you allow class to be inherited, but prevent the method from being over-ridden?
Yes, just leave the class public and make the method sealed.

50. What�s an abstract class?
A class that cannot be instantiated. A concept in C++ known as pure virtual method. A class that must be inherited and have the methods over-ridden. Essentially, it�s a blueprint for a class without any implementation.

Monday, June 8, 2009

Engineering Miracles - Weird Bridges




Engineering Miracles - Weird Bridges