You are on page 1of 65

Cateogory Ado.

Net

Level Basics

Ado.Net

Basics

Ado.Net

Basics

Ado.Net Ado.Net Ado.Net

Basics Basics Basics

Ado.Net

Basics

Ado.Net Ado.Net Ado.Net

Basics Basics Basics

Ado.Net Ado.Net Ado.Net

Basics Basics Basics

Ado.Net

Basics

Ado.Net

Basics

Ado.Net Ado.Net

Basics Basics

Ado.Net

Basics

Ado.Net

Basics

Ado.Net

Basics

Ado.Net Advanced

Basics Basics

Advanced

Basics

Advanced Advanced

Basics Basics

Advanced

Basics

DotNet DotNet DotNet Advanced Advanced Advanced Advanced DotNet

Advanced Advanced Advanced Basics Basics Basics Basics Advanced

DotNet

Advanced

Advanced

Basics

Advanced

Basics

Advanced

Basics

Advanced Advanced

Basics Basics

Advanced Advanced

Basics Basics

DotNet

Advanced

DotNet

Advanced

DotNet

Advanced

DotNet DotNet DotNet Assembly Assembly Assembly

Advanced Advanced Advanced Basics Basics Basics

Assembly Assembly

Basics Basics

Assembly

Basics

Assembly Assembly

Basics Basics

Assembly

Basics

Assembly Assembly Assembly

Basics Basics Basics

Assembly

Basics

Assembly

Advanced

Assembly Assembly

Advanced Basics

Assembly

Basics

Assembly

Basics

Assembly

Basics

DotNet DotNet

Basics Basics

DotNet DotNet

Basics Basics

DotNet

Basics

DotNet

Basics

DotNet

Basics

DotNet

Basics

DotNet DotNet DotNet DotNet DotNet DotNet DotNet Basics

Basics Basics Basics Basics Basics Basics Basics Basics

Basics

Basics

DotNet

Basics

DotNet DotNet DotNet

Basics Basics Advanced

DotNet

Basics

CLR CLR CLR CLR

Basics Basics Basics Basics

CLR Code

Basics Basics

Code

Basics

Configuration

Basics

Configuration

Basics

Configuration

Basics

Deployment

Basics

Deployment Deployment General Remoting Remoting

Basics Basics Basics Basics Basics

Security

Basics

Security

Advanced

Security

Advanced

Web Services Web Services Web Services

Basics Advanced

Web Services

Assembly RDBMS RDBMS

Advanced Basics Basics

RDBMS RDBMS RDBMS RDBMS RDBMS RDBMS RDBMS RDBMS

Basics Basics Basics Basics Basics Basics Basics Basics

RDBMS

Basics

RDBMS

Basics

RDBMS

Basics

RDBMS RDBMS RDBMS RDBMS RDBMS RDBMS RDBMS RDBMS RDBMS RDBMS Arch

Joins Joins Joins Basics Basics Basics Advanced Advanced Advanced Advanced Advanced

Arch Arch Arch Arch Arch Arch Arch Arch OOPS OOPS

Advanced Advanced Advanced Advanced Advanced Advanced Advanced Advanced Basic Basic

OOPS

Basic

OOPS OOPS

Advanced Basic

OOPS

Basic

OOPS

Basic

OOPS OOPS OOPS OOPS OOPS OOPS OOPS OOPS

Basic Basic Basic Advanced Basic Basic Advanced Basic

C# C# C# C#

Basic Basic Basic Basic

C#

Basic

C# C# C#

Advanced Basic Advanced

C#

Advanced

C#

Basic

C#

Basic

C# C# C#

Advanced Advanced Basic

C# C# C#

Advanced Advanced Basic

C# C#

Advanced Advanced

C#

Basic

C#

Basic

C#

Advanced

Question What are the advantages of a DataSet?

What is a DataView?

What are the ADO.NET classes available to work with DataSets?

How do you sort a Dataset? Can you do the sorting of a Datagrid on the client side purely? How do you pass the parameters to your stored procedure from your application? How do you create relationships between DataTables?

What is an DataRow object?

How do you filter the records in a DataSet? What is the advantage of using the Fill () method of the DataAdapter? What is a CommandBuilder object?

What are the differences between ExecuteScalar() an ExecuteReader() If I write a query like select * from emp and call the ExecuteScalar() method what will happen? Will it throw Runtime/Compile time error? Explain what is ADO.Net?

Explain differences between ADO and ADO.Net?

What are the 3 core objects of ADO.NET?

What are the methods available for a Ado.Net Connection object? What is the use of a Command Object in Ado.Net? What are the methods available on this object?

What are the disadvantages of a DataReader ? Or What are the differences betweeen a DataReader and a DataSet?

When should we use DataSet against DataReader object?

What are the different events supported by the DataList and DataGrid controls?

What type of Record locking mechanism is used in .NET? What are the tools Tlbimp, TlbExp and other tools used for?

What are the Application Domains in .Net?

What are delegates? What is the difference between classes and delegates? What are interfaces?

What are HTTP Handlers and Http Modules?

What is an AppDomain? What is the need for JIT compiler? How does it work? Why should you explicitly write Finally block? Will the code written in a Finally block always gets executed? What is the sn utility? What is CASPOL? What are the two keys involved in strong naming an assembly? How do you include a 'C' Dll in a .NET application? Is ASP.NET Thread based?

What are events in .NET and how do you handle them?

How do you manage state in ASP.Net?

How do you maintain the Application State in ASP.NET?

What is main difference between Global.asax and Web.Config?

What is the Hashtable class? What are Value Types and Reference Types? What are differences between them?

Explain the Friend keyword in a class. How are the Get and Set methods used in Vb.Net?

What are the advantages of 2-step compilation?

How do you upload a file in ASP.NET?

What is Relection?

What are Http Requests? How do you write customized HttpRequests? How do you write a client side validation for a server control like ASP button? How does the Web Server differentiates between an .ASP file and. ASPX file? What is the flow here? What is the relation between an Assembly and a Namespace? Can one assembly have more than one namespace or vice-versa? What is an Assembly? What are the different types of files available in a given assembly? Explain.

Where is the Meta data stored in Assembly? What are priavte assemblies? What are shared assemblies?

What is Global Assembly Cache? Explain.What is the GAC utility?

Can I delete the source file which I have used to register in GAC? What is the AL utility?

How should an assembly be uninstalled?

What is a Satellite Assembly? Can my assembly span more that one file? What is Versioning?

When you have multiple assemblies how do you specify the application which version to be used?

What are the types of caches available in .Net ?

How does the Assembly differentiate between a normal DLL and a Dot Net DLL? Name some of the Default Assemblies available?

What is Side By Side component versioning ?

Version information for an assembly consists of how many parts? What are they?

What is Side By Side Execution ?

What is managed code and unmanaged code? Can we write unmanaged code using other languages? Name some of the important Class libraries in .Net ?

What happens if you skip the break statement in swith block? Name some of the important Base Class libraries in .Net ?

How many forms you can have in a ASP.NET page?

How ASP.Net has improved performance compared to ASP?

How are the parameters passed in functions?

How do you say .Net is platform independent?

What are the types of Controls used on a ASP.Net page? Explain? What is a static method? Can you instantiate a static method? How is Exception handling done in .NET? Explain. What is a static Constructor? Differentiate between a constructor and a static constructor? Name all the Validation controls in ASP.NET? List the ASP.NET page events in order? How can you disable client-side validation for individual validation controls ?

What is an User Control?

What are the advantages of User Controls?

What are the 3 attributes used in the Register directive of a User Control? How do you pass values between 2 pages in ASP.NET? What is a Component? What are its advantages?

Explain how the Code-Behind works in ASP.NET?

What is CTS? What are the 3 basic services of CLR? What is Garbage Collection in .Net? When do you forcibly call Garbage collection? Why?

How do you call Garbage Collection? What are the available methods? What are Application code blocks? How are they used in DotNet?

What is Code-behind? And what is a Code-behind file?

What is the Global.asax file?

What is the signficance of Web.config?

What is the Machine.config file?

What is Xcopy command?

How do you Deploy an ASP.NET application? How do you Deploy/Destribute your C# application to 100 clients? What are the differences between Structs and Classes? What is Remoting? What is it used for? Can you explain the roles of Stub and Proxy with respect to .Net?

What are the 4 types in ASP.NET Authentication Model?

What is a Session ? What are its advantages?

Explain the Security Management in .NET Framework.

What is Remoting?Is it very similar to COM/DCOM/RMI? How do you create a Client Proxy for a Web Service? What are Web Services?

How do you use XML with DataSets?

What is the ildasm utility? What is Referential Integrity? How is it achieved? What is a Schema?

What are constraints? What is a primary key? Can it have more than one field? Why should you create an index? What are different types of indexes? what are Views? Where will you use them? Can you explicitly call a trigger? What is a Trigger and what are different types of triggers? What is the difference between a Stored procedure and a Function? What is Normalization ?

What are the different levels of Normalization? Explain each separately. Which one is the best?

What are the differences between DELETE and TRUNCATE commands?

What is a Foreign Key?

What is a Cartesian Product ? What are different kinds of JOINS? When do you use Outer Joins? How many types of Stored Procedures are there? What are the differences between GROUP BY & HAVING clauses? What are the different Aggregate Functions? What is the BCP command? (Bulk Copy Program) What is a Scroll Cursor? What are differe types of cursors? What are the ACID properties of a transaction? How do you check the performance of your Database and queries? Explain each of the layer in your application (Business Rules, Presentation Tier, Data Tier etc). Draw the architecture diagram of the application. What was approach used in the design of your application? Which design method was used in the application? What are the advantages of 3-tier Architecture? What are the difference betweeen HLD and LLD? What are the Estimation techniques used in your project? What is the tool used for Unit Testing? What are the different design patterns and explain each of them. Which design pattern you have used in your project and why? What is Polymorphism? What is the use of it? Explain with example. What is the relation between an Object and a Class?

What is an Abstract Class? What is the use of it?

What are Concrete classes? What is Overriding?

What is an interface? Have you ever written any interface?

What is Dynamic binding ?

What are the basic pillars of OO Programming Differentiate between an Abstract class and an event? Explain encapsulation. What is a static Constructor? Differentiate between a constructor and a static constructor? How do you create an Abstract Class in VB.Net? What are the differences between a Class and a Structure? Can you have a constructor inside an abstract class? Will it throw an error? What are the uses of private constructors in a class?

What are the different access modifiers in C#? Explain in detail. What are the different class modifiers? What are the different method modifiers? How the properties are handled in a class?

What is boxing and UnBoxing? What is the need for Boxing?

What is the peformance hit involved in Boxing and Unboxing? What exactly happens in the background within Heap Memory when boxing and unboxing happens? What is unsafe code?

Does C# support Operator overloading?

What are the differences between Value Types and Reference Types?

What are the differences between Boxing and Unboxing?

Does C# support multiple inheritance (MI)? What is a static constructor? Can I define my own exceptions?

How can I check the type of an object at runtime? Can I get the name of a type at runtime? What are delegates?

Is an event a Delegate? (T/F) String comparisons using == seem to be case-sensitive? How do I do a caseinsensitive string comparison?

How can I process command-line arguments?

Whats the difference between struct and class in C#?

Why do you need to box a primitive variable?

Answer A DataSet enables you to represent the results of a database query in your server's memory. It provides you with a memory-resident representation of data. Once the DataSet is populated with data, you can break the connection to its data source. The retrieved data remains in the memory of your server. Hence it represents disconnected data. You can also work with the results of the query as a whole. Also Datasets improve performance, conserve system resources (DB-Connections), and increase scalability. But they require lot of memory. A DataView represents a specific view on a DataTable. You can use it to display a filtered or sorted view of a DataTable. You can also use it to find specific rows containing certain column values in a DataTable. You can bind a Data View to a control and not a DataSet or DataTable. DataVeiw object has a property, RowFilter that can be set to filter the rows contained in the view. Bind the dataview to the control that will be used to display the filtered data. 1)DataAdapter 2)DataSet 3)DataTable 4)DataRelation 5)DataView All these classes are contained in the System.Data namespace. A DataSet can contain more than one DataTable, each database table is represented by a DataTable , the relation between the tables can be defined using the DataRelation class. A DataView represents a specific filtered or sorted view of a DataTable. A Dataset cannot be sorted directly. It can be sorted through a Dataview. Yes, a datagrid can be sorted on the client side by using a Dataview object.

You can define relationships between DataTables in a DataSet by using the DataRelation class. The most common type of relationship is the parent/child relationship. Each record in the parent has one/more corresponding records in the child. A DataSet has a Relations property that represents a collection of DataRelation classes between the DataTables contained in the DataSet. To add a new relationship to a DataSet, you must add a new DataRelation to the collection of DataRelation classes. A DataRow is used to represent a row in a DataTable. All the rows in a Data Table are contained in the Rows collection. Similarly, the Columns collection of a DataTable contains DataColumns, all the columns in the table. Using a DataView objecty and the filter condition. It automatically opens a database connection (if it is not already open) and then automatically closes the connection that it opens. You do not have to explicitly open or close database connections. Before the Update method is called, an SqlCommandBuilder object is created. This object is used to automatically generate SQL commands that are used to reconcile the changes made to a DataSet to the data source. When working with the CommandBuilder class, 2 points must be taken care of. 1) The DataTable must represent a single database table. 2) The DataTable must represent a database table with a primary key/unique column. In short, CommandBuilder objects create suitable "auto-generated commands" for use when pushing changes back to a data store via a DataAdapter object. The ExecuteScalar() method returns a single value while as a ExecuteReader() method returns a reader object containing read-only rowsets.

The basic premise of ADO.NET is the notion of disconnected data. It enables data stores to cater to a greater number of clients by just providing them with the required data and then breaking the connection. Clients can then process the data as required and even use client side scripting to provide interactivity to users. Clients can sort, filter and have different views of the data. While ADO also enables clients to work with disconnected recordsets, ADO.NET also provides the benefits of increased interoperability, scalability, and strong typing.

1) For disconnected applications, ADO.NET offers performance advantages over ADO disconnected record sets. Whereas ADO requires that transmitting and receiving components be COM objects, ADO.NET transmits data in standard XML format so that COM marshaling or data-type conversions are not required . The basic premise of ADO.NET is the notion of disconnected data. While ADO also enables clients to work with disconnected recordsets, ADO.NET also provides the benefits of increased interoperability, scalability and strong typing. 2) InterOperability : ADO.NET uses XML to transmit data between any 2 components in the network. ADO.NET data can cross through corporate intranet firewalls because it is transmittted using XML and HTTP. But, ADO data sent using COM specifications cannot always pass through firewalls. 3)Maintainability : If the original application is implemented in ADO.NET using ADO.NET objects known as datasets, such re-designing is easy. The newly created tiers can exchange information through XML-formatted datasets. 4)Programmability : ADO.NET data classes generated by the tools result in typed datasets. This in turn allows you to access data through typed programming. The code for the typed dataset is easier to write because statement completion is provided, and safer, because it provides for the compile-time checking of types. 5)Performance : For disconnected applications, ADO.NET datasets offer performance advantages over ADO disconnected recordsets. 6) Scalability : ADO.NET accomodates scalability by encouraging programmers to conserve limited resources. It does not retain database locks or active database connections for long durations. 7)ADO uses disconnected access to data using Connection (also Command obj some times) to fill a RecordSet then removes the connection to the data store. ADO.Net uses a Connection and a Command to connect a DataAdapter to the data source and then fill a DataSet with the results. 8)ADO updates a data store from a disconnected RecordSet by reconnecting and using the Update or UpdateBatch method. ADO.Net uses a Connection and a Command to connect a DataAdapter and DataSet to the data source and then call the Update method of the DataAdapter. 9) Client Side Cursors and database locking are not available in Ado.net. 10) Like ADO, in ADO.Net we can execute a sql statement directly using a Connection object on the Data Source. 1)Connection : Establishes a connection to a specific data source 2)Command : Executes a commond (a SQL statement, or a stored procedure) against a data source. 3)DataReader : Reads a forward-only, read-only stream of data from a data source. 1) Open 2) Close & 3) BeginTransaction The Command Object allows us to execute a SQL statement or stored procedure in a data source. This includes returning a rowset (in which case we use another object such as a DataReader or DataAdapter to access the data), returning a single value (a singleton), or returning a count of the number of records affected for queries that do not return a rowset. Methods : 1) ExecuteNonQuery : does not return any row 2) ExecuteReader : returns a reader object 3) ExecuteXMLReader : equivalent of the above method to return an XML document fragment. 4) ExecuteScalar : Returns only a single value

1) It can only work with a single record at a time. When you fetch a new record, the previous record is lost. 2) So you cannot filter or sort records or count the number of records retrieved by a query. 3) It is not a Disconnected data source.i.e. the DataReader must remain connected to the database table because it is tied to its underlying data source. 4) You cannot cache it in your server's memory so that you may use it across multiple requests to the same page or across multiple pages. 5) A DataReader provides a ReadOnly and Forward-Only access to data while as a DataSet provides both read and write access to data. 6) A DataReader can store data from only one rowset at a time, while as a DataSet can store data from multiple tables and even relationships between them. 7) The DataSet even contains the metadata describing the table contents, such as the column types, rules, and keys. We should use the DataSet 1) When we need to remote the data, i.e. disconnect from the data store and pass the data to another tier in the application, to a client application, store it ready for use in a process, edit the data, or in some similar scenario. 2) When we need to store, transport, or access more than one table, and optionally the relationships between these tables. 3) When we need to update the data in the source database using the built-in methods of the DataSet and DataAdapter rather than executing individual SQL UPDATE statements or stored procedures. 4) When we need to take advantage of the synchronization between an XML document and the equivalent "relational" rowset. 5) In certain data-binding scenarios, such as binding the same data to several controls, or using automatic record paging in a DataGrid control, we cannot use a use a DataReader as the data source. 6) If we are iterating through the data rows, and need the freedom to be able to move backwards and forward in the rowset. These are 1)ItemCommand 2)UpdateCommand 3)EditCommand 4)DeleteCommand 5)CancelCommand Within .NET, all the data access is through Optimistic record locking, which allows multiple users to open the same record for updating. tlbimp.exe : This utility is used as the type library import tool to create the wrapper class for us. The syntax is : tlbimp.exe TypeLibray [options] By default the output name will be the same as the COM type library, not the filename. For example blbimp msado15.dll will produce a wrapper assembly called ADODB.dll, not msado15.dll The resulting assembly can then be copied into the application bin directory (or installed in the Global Asembly Cache), and referrenced as with other .NET assemblies. <%@ Import Namespace="ADODB" %> tlbexp.exe utility : This is the Export Type library utility Once the .NET assembly has been created, you need to create a COM type library so that COM clients can set references to the classes. This is done using the Type LIbrary Export tool, the syntax is as below tlbexp Assembly Name [options]. For eg., if the Person class were compiled into a Person.dll assembly, we would use : tlbexp Person.dll By default this creates Person.tlb

Application Domains (AppDomains) in .NET have the same benefits as a process, but multiple application domains can run within the same process. Application Domains(AppDomains) can be implemented safely within the same process, because the code verification feature of the CLR enusres the code is safe to run before allowing it to execute. This provides a huge scalability and reliability benefit. When running as part of IIS4/5, ASP.NET uses AppDomains to run each instance of an ASP.NET application. Each ASP.NET application runs in its own application domain, and is therefore protected from other ASP.NET applications on the same machine. ASP.NET ignores the process isolation specified in IIS. Other Defn : The process space in which an ASP.NET application runs is known as a .NET runtime Application Domain. The process isolation between different applications prevents versioning/naming conflicts among resoures belonging to different applications, and provides security sandboxing. Sandboxing an application implies that the application cannot access certain machine/network resources. For instance, the application cannot write to the hard disk without the system owner's permission. This greately enchances system security and safeguards users from malicious applications. Advantages of application domains : 1) You can host multiple applications on a single Web Server. The code executing in one application cannot directly access code and resources in another application. 2) If one application is shut down or crashes, it has no effect on other applications running on same server. You can safely test applications under development on a live Web Site. 3) Assemblies in one domain are not shared with other domains. Different applications can use different versions of a component without any conflict. 4) You can set application wide security policies. You can have trusted an untrusted application domains with different sets of permissions. 5) You can specify different configuration settings for different applications. Delegate is like a pointer to a function call. An interface is the description of the methods and properties a class will expose-it's an immutable contract with the outside world. The interface doesn't define any implementation-just the methods and properties. Derived classes then have to provide the actual implementation.

HTTP Handlers : These are also known as request handlers. They are .NET classes that implement IHttpHandler interface. Note : The IHttpHandler interface replaces the Internet Services Application Programming Interface (ISAPI) of ASP. HTTP handlers are used to process requests for ASP.NET resources on an ASP.NET Web site, such as ASP.NET pages (or Web services, or other files). An HTTP hanlder can process requests made for a file with a certian extension, path or request type. <configuration> <httpHandlers> <add verb="*" path="*.aspx" type="System.Web.UI.PageHandlerFactory"/> <add verb="*" path="*.asax" type="System.Web.HttpForbiddenHandler"/> <add verb="*" path="*.ascx" type="System.Web.HttpForbiddenHandler"/> <add verb="*" path="*.config" type="System.Web.UI.HttpForbiddenHandler"/> <add verb="*" path="*.vb" type="System.Web.UI.HttpForbiddenHandler"/> <add verb="*" path="*.config" type="System.Web.UI.HttpForbiddenHandler"/> <add verb="**GET,HEAD" path="*" type="System.Web.UI.HttpForbiddenHandler"/> Verb : speicifies the HTTP protocols that are supported and can be used to make requests. It can be used as a filter. Path : specifies the types of files that can be handled by this handler. It is used to filter requests to different HTTP handlers. If you specifiy *.aspx, only .aspx files can be processed by this handler. Type : specifies the HTTP handler that will handle the request. By default all requests for files with the extension .aspx are handled by the PageHandlerFactory class. This class produces instances of the PageHandler class to service each request for an ASP.NET page. Any requests for files of type .asax, .config, or .b will be rejected by the HttpForbiddenHandler class. This safeguards files such as Global.asax, and web.config from being tampered by casual users or hackers. HTTP Modules : In simplest words, HTTP Modules act as filters (HTTP Modules are similar in function to ISAPI filters) that we can apply before the handler sees the request or after the handler is done with the request. An HTTP module also enables you to gain low-level access to HTTP requests and responses processed by the ASP.NET Framework. Unlike a handler, however, an HTTP module enables you to participate in the processing of every request. For example, the Output cache, session state, forms authentiation, and Windows authentication

It is the Strong Name utility, used when an assembly has to be put in the Global Assembly Cache to be shared by many applications. That is the assembly that needs to be strong named before it is placed in GAC. Cascaded Security Access Policy import--> wrapper-->TlbImp.exe--Interoperability ASP.Net is process-based and not thread-based. You can run multiple processes on a server without having to stop and restart the server. You can control the number of processes on a server without having to stop and restart the server. You can control the number of processes that can run at a time on a server using the Web.config file. You can also specify when these processes should be rebooted in the Web.Config file. Each process can be killed (stopped) and restarted independently of other processes.

ASP.NET Framework includes various options to manage state, including both client-side and server-side implementations. Client-Based State Management options : 1)View State : 2)Hidden Form Fields 3)Cookies 4)Query Strings Server-Based State Management Options : 1) Application State : ASP.NET allows you to save values using application state. Application state is global to all pages in the Web application and is useful for storing information that needs to be maintained between server round trips and between pages. Application state is stored in the Application object as Key-value pairs. 2) Session State : ASP.NET allows you to save values using session state.It is similar to application state except that it is scoped to the current browser session. 3) Database Support : Maintaining state using database technology is a common practice when storing userspecific information where the information store is large. 1)User State (Session) : User state is controlled through the Session object. 2)Application State : Application state is controlled through the Application object. 3) Transient Application State (Cache) : Transient Application state is controlled through the Cache object. Cache is similar in functionality to Application, in that it is accessible (shared memory) for our entire web application. Cache however, adds some functionality not available to Application, in the form of dependencies, callbacks, and expiration. 4) Static Variables : We can declare static variables and only one copy of the variable is created no matter how many instances of the class are created. The static variable is accessible throughout our application and in some cases is more efficient than Application. ASP.NET uses the global.asax to establish any global objects that your Web application uses. The .asax extension denotes an application file rather than .aspx for a page file. Each ASP.NET application can contain at most one global.asax file. The file is compiled on the first page hit to your Web application. ASP.NET is also configured so that any attempts to browse to the global.asax page directly are rejected. However, you can specify application-wide settings in the web.config file. The web.config is an XML-formatted text file that resides in the Web sites root directory. Through Web.config you can specify settings like custom 404 error pages, authentication and authorization settings for the Web site, compilation options for the ASP.NET Web pages, if tracing should be enabled, etc The Hashtable class is a simple dictionary class populated using a reference from the collection very efficiently. Since all types derive from System.Object, we can hold any type in a Hashtable. 1) Value Types are like Primitive types in VBScript, VB6 and C/C++. Reference Types are like object types. 2) Value types are allocated on the Stack. Reference types are allocated on the managed CLR Heap. 3)Value types are not instantiated using new (unless parameterized constructor used), and go out of scope when the function where they are defined within returns. Values types in the CLR are defined as types that derive from System.ValueType. Reference Types are derived from System.Object. The class is only accessible from this assembly. A property defined as ReadOnly can only have the Get block. Likewise, a property with only a Get block must be marked as ReadOnly. The same applies for WriteOnly and the Set block. There is no logner a Let option, as Let and Set are now both the same. The keyword value is used in the Set block which contains the value of the property being set. The first time a user requests your ASP.NET page, the page is compiled into a .NET class (in the MSIL format). This class file is saved in a directory known as Temporary ASP.NET Files on the server. When the same page is requested again, the corresonding class file is executed. The class file is compiled with the .NET Framework Just in-Time (JIT) compiler into native machine code and executed. Such a 2-step compilation method offers the following advtgs : a) Compiling and caching the source code in an intermediate format reduces the response time as compared to interpreting and executing the source code at runtime. b) The IL code can be executed on any platform, as it is in a binary format.

Reflection is the namespace containing classes which help us in examining the details of the manifest. The manifest is stored as binary data. The default name of the assembly created by a compiler reflects the output filename created, minus the extension.

There is no relationship between them. An Assembly can be implemented as .dll file or a .exe file, while as a namespace will ususally be implemented as a .dll file. An assembly can have references to many namespaces and a namespace can also have multiple assemblies. An assembly is a collection of one or more files, with one of those files (either a DLL or EXE) containing some special metadata known as assembly manifest. The assembly manifest defines what the versioning requirements for the assembly are, who authored the assembly, what security permissions the assembly requires to run, and what files form part of the assembly. An assembly is created by default whenever we build a DLL. We can examine the details of the manifest programmatically using classes located in the System.Reflection namespace. We can also use the tool called ILDASM (Intermediate Language Dissembleer) for this. When using this, we can use the File|Open menu to open up the dll created. Once loaded, ILDASM shows a tree control containing an entry for the assembly manifest, and an entry for each type defined in that DLL. To use assembly attributes we have to import the System.Refection namespace. The Meta data is stored in Manifest. The manifest is stored as binary data. So we can see the decompiled form of the manifest, by using ILDASM tool. We create private assemblies when we build component files like DLLs that are only used by our application, but for the most part, this is an implementation detail we can ignore. However if we want to share component files across multiple web applications, we may need to create Shared assemblies and put them in the GAC, and understand the more complex versioning implications these have. Global Assembly Cache is the area in memory where all the shared assemblies are registered, gacutil is the utility used to register the assembly in the global assembly whenever it needs to be shared by other applications. Yes, the assembly makes a copy in the GAC folder. So the source file can be deleted The Assembly Linker utility generates a file with an assebly manifest from one/more files that are either modules or resource files. A module is Microsoft Intermediate language (MSIL) file that does not have an assembly manifest. The following command removes the assembly hello from the global assembly cache(GAC) as long as no reference counts exist for the assembly. gacutil /u hello A Satellite Assembly is the assembly which contains the resources specific to the selected Locale. Yes, assembly can have more that one file. Each file can be developed from different language too. Using the al.exe utility all the required files are grouped and made into single file. Each assembly has a 128-bit version number that is presented as a set of four decimal pieces: Major.Minor.Build.Revision For example, an assembly might have the version number 3.5.0.126. By default, an assembly will only use types from the exact same assembly (name and version number) that it was built and tested with. That is, if you have an assembly that uses a type from version 1.0.0.2 of another assembly, it will (by default) not use the same type from version 1.0.0.4 of the other assembly. This use of both name and version to identify referenced assemblies helps avoid the "DLL Hell" problem of upgrades to one application breaking other applications. In this case we have to specify the fully qualified details like below the fully specified version number, culture, and public key. gacutil /u hello, Version=1.0.0.1, Culture="de", PublicKeyToken=45e343aae32233ca

1) GAC, or Global Assembly Cache - all shared assemblies live here 2) Download Cache - when you execute an assembly from a URL, this is where the downloaded assemblies end up 3) 'ZAP' Cache - this cache seems to serve as the home for pre-compiled native assembly images that are produced by NGEN This is through CCR, COM Callable Wrapper..details to be given 1) mscorlib.dll - Base classes, such as the definition of Object, String and so on 2) System.dll - Additional base classes, such as the network class libraries. 3) System.Web.dll - Classes for ASP.NET 4) System.Data.dll - Classes for ADO.NET 5) System.Web.Services.dll - Classes for ASP.NET web services 6) System.Xml.dll - Classes for XML 7) System.Drawing.dll - Classes for graphics and drawing The CLR can load multiple versions of the assembly at the same time. This basically solves DLL hell- the problem where installing a new application might break other applications, because newer DLLs are installed that older applications are not compatible with. This is known as side-by-side component versioning and deployment. The manifest for an assembly has 2 attributes. 1) .ver - Specifies the version of the assemly compiled against. The CLR uses the format Major:Minor:Build:Revision for version numbers. An assembly is considered incompatible if the Major or Minor version numbers change. .hash : A hash value that can be used to determine if any of the files in the referenced assembly are different. Format of the assembly attribute: vb.net : <assembly: AssemblyVersion("1.0.1.0")> c#.net : [assembly: AssemblyVersion("1.0.1.0")] 2).hash - A hash value that can be used to determine if any of the files in the referenced assembly are different. .Net allows different versions of the same components to co-exist and run side-by-side on the same machine and within the same process. Running multiple versions of the same code simultaneously is referred to as side-byside execution The code produced for an application designed to run under the CLR is called managed code. Code written with language like VB doesn't provide IL and doesn't need the CLR to run is called unmanageed code. 1) Data Acceess - High performance data access classes for connecting to SQL Server/other OLEDB provider. 2) XML Support - Next generation XML support that goes for beyond the functionality of MSXML. 3) Directory Services -Support for accessing Active Directory/LDAP using ADSI. 4) Regular Expression - Support above & beyond that found in Perl 5. 5. Queuing Support - Provides a clean object-oriented set of classes for working with MSMQ. It gives a compile time error as 'Control cannot fall through from one case label to another'. 1) Collections- The System.Collections namespace provides numerous collection classes. 2) Thread Support - The System.Threading namespace provides support for creating fast, efficient, multithreaded applications. 3) Code Generation -The System.CodeDOM namespace provides classes for generating source files in numerous languages. 4) IO - The System.IO namespace provides extensive support for working with files and all other stream types.. 5. Reflection - The System.Reflection namespace provides support for load assemblies, examining the types within assemblies, creating instances of types, etc. 6) Security - The System.Security namespace provides support for services such as authentication, authorization, permission sets, policies, and cryptography. Only one

1)To ensure optimal perfomance, the CLR compiles all aplication code into native machine code. This conversion can either be done just in time as an application runs (on a method-by-method basis), or when an application is first installed. The compilation process will automatically make use of the microprocessor features available on different platforms, something traditional Windows applications could never do.Well written ASP.NET will run two to four times faster than equivalent ASP applications with similar gains in the area of scalability. 2) When a page is first requested, ASP.NET compiles the page into an assembly. The assembly created is assigned a unique name, and is placed in a sub-directory within the directory %Systemroot%/Microsoft.NET/Framework/v1.n.nnnn/Temporary ASP.NET Files. The assembly contains a single generated class that derives from the System.Web.UI.Page class. This class contains all the code needed to generate the page, and is instantiated by the framework to process a request each time the .aspx page is requested. When a .NET class is generated for an .aspx page, the dependencies of that page - such as the .aspx page and any include files-form part of the compiled class. These dependencies are checked before a page is rendered, and if it's determined that any of the dependency files have changed since the page was compiled, the assembly is deleted and a new one is created. This ensures that the page rendered is always up to date. Function parameters are passed by ByVal. This means that to achieve reference parameters, you must explicitly put ByRef in front of the paramter name. For optional parameters now we have to specify a default, and the IsMissing method is removed. .NET has been designed with multiple platform support as a key feature. Code written using the .NET Framework can run on all versions of Windows (95/98/NT/2000/XP etc). Depending on the class libraries used, the same code will also execute on small devices on operating systems such as Windows CE which will run a special compact edition of .NET. However, unlike Java, .NET doesn't promise that all classes will work on all platforms. A static method is one which is common to all the instances of the class. No. It can be directly called by using the Class name directly. The error handling in .NET is more structured than in ASP. Here we have got Try/Catch Exection blocks like in Java where in we can handle specific exceptions. The static constructor executes only once irrespective of the number of instances of the class. 1) RequiredField Validator 2) Compare Validator 3)Range Validator 4) Regular Expression Validator 5) Custom Validator 6)Validation Summary 1)Init 2)Load 3)PreRender 4) Control Events and 5) Unload You can disable client-side form validation by using the following page directive. <@ Page ClientTarget="DownLevel"%> You can also disable client-side validation for individual validation controls by setting the EnableClientScript property to False. A User Control is an ASP.NET page that has been converted into a control. It enables you to reuse the same content and programming logic on multiple ASP.NET pages. A User Control has the extension, .ascx. It cannot be opened directly in a browser. It must be used in another ASP.NET page. Eg. it can be used for static content like headers and footers. If you have a set of ASP.NET controls that you wish to use multiple times across different pages, you can save that set as a user control. A user control can contain HTML and Web controls, both. Event Handling : A user control can contain the same event-handling subroutines as a normal ASP.NET page. For instance, it can have a Page_Load subroutine that executes before any of the content of the control is rendered. It is different from the Page_Load subroutine of the hosting page.

1)Reusability 2) Independence 3) Language Independence 4) Parameterization When the hosting ASP.NET page is run in a browser, the user control is compiled and the compiled code is integrated with the hosting page. To improve performance, the user control is compiled the first time it is requested. The compiled code is used whenver a user requests a hosting page. This continues till the source code of the user control changes. At this point, the cached version of the compiled user control is discarded and the user control is compiled again. 1) TagPrefix 2)Tag Name 3) SRC

A Component is a package containing the application logic stored as a .vb file. It can contain one/more vb classes. To use the component, you must compile it and save it in the /bin directory of the ASP.NET appliction. Advantages : a) Enable to separate presentation content from application logic. B) Enable code reusability c) Components are compiled.d)can be written in multiple languages. e)enable to build multi-tiered Web applications. Note : a) Components can not refer to the controls in an ASP.NET page directly. b) You need to import namespaces in a VB class file because it has no default namespaces like an ASP.NET page. c) You do not have to register a component before using it. Information about the component is not stored in the system registry. d) You do not have to restart a Web Server when a component chages. ASP.NET uses shadow copies of components (maintained in a separate directory) and not the component files directly. The component files are not locked when the component is in use. When you replace a component in the bin directory, the Web server completes all current requests with the old version of the component in the shadow directory. As soon as all the current requests end, the shadow copy of the old component is automatically replaced by the new component. All new requests are handled by the new component. The integration (of code and user interface) is made possible because ASP.NET supports the object oriented programming model. The file containing the code or application logic is compiled into a DLL file and inserted into the ASP.NET page as a COM+ object just like any other component, say for example, a calendar control. This is the reason why an ASP.NET is said to be structured tree-like hierarchy of objects. Note : Code-behind contains a class that inherits from the System.Web.UI.Page class. The code-behind file thus actually an instance of an ASP.NET page. You can inherit multiple pages from the same code-behind file. Advantage : It can access the controls in the ASP.NET page and manipulate them in the code.

1) Garbage Collection 2) Code Verification 3) Code Access Security. Garbage Collection is a feature of the CLR, which runs in the background collecting unused object references, freeing us from having to enusre that we always destroy them. Since Garbage Collection is a background task, the disadvantage is that we don't know exactly when our destructor is called. Hence we have to do a forcible Garbage collection if we have any code in the destructor that has to be executed after the destruction of the object. However we can try to call the garbage collection by calling the System.GC.Collect(); method

Code-behind is an ASP.NET feature that enables separation of code and content. The integration (of code & user interface) is made possible because ASP.NET supports the object-oriented programming model. Basically it is a class file. This intrincsic Page class serves as a container class for all of the components that make up a page.The file containing the code or application logic is compiled in to a DLL file and inserted into the ASP.NET page as a COM+ object just like any other component, viz calendar control. This is the reason an ASP.NET page is said to be structured tree-like hierarchy of objects. It has a advtg, that it can access the controls in an ASP.NET page and manipulate them in code. The Code-behind file contains a class that inherits from the System.Web.UI.Page class. The Code-behind file is thus actually an instance of an ASP.NET page. You can inherit multiple pages from the same code-behind file. An ASP.NET application is associated with an optional global application file known as Global.asax. The Global.asax file, also known as the ASP.NET application file, contains code for responding to application-level events raised by ASP.NET. It can also contain declarations of application objects. It is located in the root directory of the application. It cannot be accessed by users due to security reasons. Modifying this file will restart the application and the applcation and session is lost. When the application is first requested, the Global.asax fiel is parsed and compiled into a dynamically generated .NET Framework class derived from the HttpApplicatoin base class. The application state is restored and the event handlers are invoked as and when the events in the file are triggered. The Global.asax file itself is configured so that any direct URL request for it is automatically rejected; external users cannot download/view the code written in it. Application Events : Application_Start : When application first starts, used for application-wide settings. Application_End : When application ends, used for cleannup application code/global references related to application.. Init : Triggered after an application instance is created , used for setting that must be initialized once for every application instance. Dispose : Before an applicaiton instance ends, used to clean up application instance specific code. Application_BeginRequest : When a new request is received, it is the first event that is handled when an application begins. This is used to handle request specific settings such as on page load. Application_EndRequest : When a request ends, the last event that is handled before the application ends. It is used to clean up request specific code such as page unload. Application_Error : When a unhandled error occurs in the application, used to provide error handling or logging before displaying the error to the user. Errors within a try..catch block will not raise this event. Application_AuthenticateRequest : When a request is ready to be authenticated by the security module.This is used to run the code before the user is authenticated, can be used for Custom authentication. Application_AuthorizeRequest : When a request is ready to be authorized by the security module. This is used to run code before the user is authorized. Application_PreSendReqestContent : Before sending content to the browser, it occurs before the response is sent. Application_PresendRequestHeaders : Before sending headers to the browser, occurs before the response is sent to the browser.

ASP.NET aims to make configuration of applications easier. It does not use the metabase but a standard, humanreadable XML file known as Web.Config to store settings. The Web.Config file does not use the system Registry, or the metabase to save configration information. The ASP.NET Framework reads the configuration information directly from the file. This means that you can move an ASP.NET application to a new server simply by copying all the files including the Web.Config file to the new server. Different sections of Web.Config : trace : configration settings for page and application tracing. Globalization : specifies the character encoding to use with requests and responses. HttpRunTime : specifies the max. amount of time that a page will execute without timing out, the max. size of a request, and whether the fully qualified URLs should be used for client redirects. Compilation : contain configaration information for compiling pages. You can specify whether ASP.NET pages should be compiled in debug mode. You can also specify the assemblies available in an applciation. By default, all assemblies are located in the /bin directory are available to the application but you can make only select assemblies available. Pages : specifies configuration information for ASP.NET pages. You can disable page buffering, session state, or view state. CustomErrors : specifies how error information should be displayed. Authentication : specifies information for authentiating users. Identity : configures user account impersonation. authorization : specifies the users and roles auithorized to access files. machineKey : used for sharing a standard encryption key across machines in a Web farm. Trust : used for setting security policies securityPolicy: contains a list of available security policies sessionState : contains configuration information for session state. You can enable out-of-process, in-process, or coookiless sessions here. httpHandlers : associates a particular HTTP handler with a particular page path and request verb. httpModules : lists the modules that are involed in every page request. processModel : configures the process model settings on IIS. webControls : specifies the location of the client-side script library used with Web controls, such as validation controls. clientTarget : lists the value that you can use with the ClientTarget property. At the top of the hierarchy is the Machine.Config file, which specifies the settings that are global to a particular machine. This file is located in the following path: \\WINNT\Microsoft.NET\Framework\[Framework version]\CONFIG\machine.config The DOS Xcopy command is a simple way to copy a project or application from one location to another. As with the Copy Project command, Xcopy does not register or verify the location of assemblies, and for Web projects it does not automatically configure IIS directory settings. More importantly, using Xcopy to deploy an application will not take advantage of Windows Installer Zero Administration Windows (ZAW) features, making it possible to overwrite files that could cause other applications to break. The deployment of an ASP.NET application is radically simpler. To install an application requires two steps :1) Create a web site or virtual directory 2) XCOPY application files into the directory.

1) Windows Authentication - targeted mainly at intranets, where domain accounts can be used to identify users. 2) Forms Authentication - Cookie-based authentication as used by sites such as Amazon. 3) Microsoft Passport Authentication - Cookie-based authentication performed by Passport Manager, used by sites as Hotmail. 4) Client Certificate Authentication A session refers to the time duration during which a specific user is connected to a particular Web site. It begins when the user connects to the site and ends after the user leaves the site. The concept of a session was developed to overcome the limitations of HTTP. HTTP is a stateless protocol. The Web server cannot store information about a user over multiple pages, let alone over a period of time. Advantages of Sessions : Sessions can store user preferences. Sessions can maintain virtual lists. Sessions can keep track of the pages that are preferred by users and the order in which they navigate through the stie. ASP.NET works in concert with the .NET Framework and IIS to provide Web application security. To secure an ASP.NET application, there are 3 functions. 1) Authentication : It assures that the user is, in fact, who the user claims to be. User credentials are validated against some authority. 2) Authorization : It limits access rights by granting or denying specific permissions to an authenticated identity. 3) Impersonation : It enables the ASP.NET application to execute in the context of an authenticated or anonymous user when the request is passed to the application from IIS. Access is then granted or denied based on the impersonated identity. IIS can also grant/deny access based on a user's host name or IP address. ASP.NET application developer also has access to all of the built-in security features of the .NET Framewrk, such as Code Access Security(CAS) and role-based user-access security.

Web Services are programmable business logic components that serve as 'black boxes to provide access to functionality via the Intenet using standard protocols such as HTTP. Web Services are based upon an application of XML called the Simple Object Access Protocol (SOAP). SOAP defines a standardized format for enveloping XML payloads exchanged between two entities over standard protocols such as HTTP,. SOAP is based completely upon open standards. The consumer of a Web Service is therefore completely shielded from any implementation details about the platform exposing the Web Service - the consumer simply sends and receives XML over HTTP. This means that any Web Service on a Windows platform can be consumed by any other platform, such as UNIX. In simpler words an XML Web service is a component containing business functionality exposed through Internet protocols. It enables you to exchange information (across firewalls) between Web-based applications using standards like HTTP, Simple Object Access Protocal (SOAP), and XML messaging. XML 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 mode, and running on any operating system can access them. A DataSet can be used to represent not just relational data (from a relational database such as SQL Server), but also XML data. It can represent XML data in two ways: 1) You can load XML data directly into a DataSet 2) You can build an XmlDataDocument class from an existing DataSet. You can read an XML file into a DataSet by using the ReadXml() method of the DataSet class. Ildasm is the utility used to see the Assembly manifest content. A Schema is a logical set of tables, usually it is simply thought of as a 'Database', but a database can hold more than one Schemas.

No we cannot The stored procedure is a pre-compiled set of sql statements stored on the server and it runs more faster than Normalization is a database deisgn technique that suggests that certain criteria be used when constructing table layout (deiciding what columns each table will have and creating the key structure), where the idea is to avoid redundancy of non-key data across tables. Normalization is usually referred in 'forms'. First Level Normalization refers to moving data into separate tables where data in each table is of a similar type, and by giving table a primary key. Putting data in Second Level Normalization involves removing to other tables data that is only dependant of a part of the key. Third Level Normalization involves getting rid of anyting in the tables that doesn't depend soley on the primarky key. Only include the information that is dependant on the key, and move off data to other tables that are independant of the primary key, and create a primary key for the new table. DELETE is a logged operation hence anything which is deleted with DELTE statement can be rolled back before the COMMIT. However TRUNCATE is an un-logged operation hence it can NOT be rolled back. TRUNCATE is faster than DELETE. TRUNCATE doesn't have a WHERE clause while as a DELETE can have. A Foreign Key is a column in a table where that column is a primary of another table, which means that any data in a Foreign Key column must have corresponding data in the other table where that column is the primary key. In DBMS terminology, this is called Referrential Integrity. It is a Join statement without a Where clause. The Outer Join is used whenever a join query is "United" with the rows not included in the join, and are especially useful if constant text "flags" are included. 3, a) System b) User defined c) Compiled .dll files

An object's implementation is defined by its class. The class specifies the object's internal data and represenation and defines the operations the object can perform. Objects are created by instantiating a class. The objects are said to be an instance of the class. The process of instantiating a class allocates storage for the object's internal data made of instance variables and associates the operations with these data.

An Abstract Class is one whose main purpose is to define a common interface for its subclasses. An abstract class will defer some or all of its implementation to operations defined in subclasses; hence an abstract class cannot be instantiated. The operations that an abstract class declares but doesn't implement are called abstract operations. Classes that aren't abstract classes are called concrete classes. A class may override an operation defined by its parent class. Overriding gives subclasses a chance to handle requests instead of their parent classes. Class inheritance lets you define classes simply by extending other classes, making it easy to define families of objects having related functionality. The set of all signatures defined by an object's operations is called the interface to the object. An object's interface characterizes the complete set of requests that can be sent to the object. Any request that matches a signature in the object's interface may be sent to the object. An object's interface says nothing about its implementation-different objects are free to implement requests differently. Dynamic binding means that issuing a request of an object doesn't commit you to a particular implementation until run-time. Also Dynamic Binding lets you substitute objects that have identical interfaces for each other at runtime. This substitutivity is called as Polymorphism.

The implementation is hidden, the interface is exposed. The static constructor executes only once irrespective of the number of instances of the class. Define the class with the keyword 'MustInherit' The C# compiler allows this code to compile, while there is no way i can call this contructor from the outside world. It can be called from derived classes only. So shouldn't it allow 'protected' and 'private' modifiers only A private constructor is a special instance constructor. It is commonly used in classes that contain static members only. If a class has one or more private constructors and no public constructors, then other classes (except nested classes) are not allowed to create instances of this class. 1)public 2)protected 3)internal 4)protected internal 5)private 6)abstract 7)sealed 1) public 2)protected 3)internal 4)protected internal 5)private 6)static 7)virtual 8)override 9)abstract 10)extern They are implemented as public member variables or by using the property accessors. No specific keywords to identify read-and write-only properties. If only the get accessor is provided then the property is read-only, and if only the set accessor is provided then the property is write-only. Both accessors imply a read/write property. When working with collections of System.Object types, the CLR automatically convert value types into reference types. This conversion happens when we assign a value type, such as a primitive type like System.Int32, to an object reference, or vice versa. Boxing is basically the process of conversion from a value type to an object reference. Unboxing is the process of converting a object reference to a value type. When Boxing occurs, the contents of a value type are copied from the stack into memory allocated on the managed heap. The new reference type created contains a copy of the value type, and can be used by other types that expect an Object reference. The value contained in the value type and the created reference types are not associtated in any way. If we change the original value type, the reference type is not affected. When Unboxing occurs, memory is copied from the managed heap to the stack.

Using unsafe code we are able to use C# code in an unsafe manner, where we can use pointers, unsafe casts, and so on. This helps in fullfulling diverse need for total control, when the performance is an issue, when dealing with binary structures, or for some advanced COM support. C# is the only language that supports Operator overloading.

1) Value types are allocated on the stack, just like primitive types in VB Script, VB6, and C/C++. Reference types are allocated on the managed CLR heap, just like object types. 2) Value types are not instantiated using new (unless it has a parameterized constructor), and go out of scope when the function they are defined within returns. Value types in the CLR are defined as types that derive from System.ValueType. All of the CLR primitive types such as System.Int32 derive from this class. 3) Refrence types are instantiated using the 'new' keyword while value types can be instantiated directly. C# divides types into two categories - value types and reference types. Most of the basic intrinsic types (e.g. int, char) are value types. Structs are also value types. Reference types include classes, interfaces, arrays and strings. The basic idea is straightforward - an instance of a value type represents the actual data (stored on the stack), whereas an instance of a reference type represents a pointer or reference to the data (stored on the heap). The most confusing aspect of this for C++ developers is that C# has predetermined which types will be represented as values, and which will be represented as references. A C++ developer expects to take responsibility for this decision. 4) The value-type variables are not garbage-collected, they just fall off the stack when they fall out of scope, the reference-type objects are picked up by GC when their references go null In boxing CLR will automatically conver value types into reference types. This conversion happens when we assign a value type, such as a primitive type like System.Int32, to an object reference, or vice versa. When boxing occurs, the contents of a value type are copied from the stack into memory allocated on the managed heap. The new reference type created contains a copy of the value type, and can be used by other types tat expect an object reference. The value contained in the value type and the created reference types are not associated in any way. If we change the original value type, the reference type is not affected. When unboxing occurs, memory is copied from the managed heap to the stack. C# supports multiple inheritance of interfaces, but not of classes. A constructor for a class, rather than instances of a class. The static constructor is called when the class is loaded. Yes, as long as you follow the rule that exceptions derive from System.Exception. More specifically, MS recommend that user-defined exceptions inherit from System.ApplicationException (which is derived from System.Exception). You can use the is keyword. For example: Yes, use the GetType method of the object class (which all types inherit from). A delegate is a class derived from System.Delegate. However the language has a special syntax for declaring delegates which means that they don't look like classes. A delegate represents a method with a particular signature. An instance of a delegate represents a method with a particular signature on a particular object (or class in the case of a static method). Use the String.Compare function. Its third parameter is a boolean which specifies whether case should be ignored or not. "fred" == "Fred" // false System.String.Compare( "fred", "Fred", true ) // true

Like this: using System; class CApp { public static void Main( string[] args ) { Console.WriteLine( "You passed the following arguments:" ); foreach( string arg in args ) Console.WriteLine( arg ); } } 1) Structs cannot be inherited. 2) Structs are passed by value, not by reference. 3) Struct is stored on the stack, not the heap. To pass it by reference or apply a method that an object supports, but primitive doesnt.

You might also like