Friday, June 5, 2015

DotNet Webservice



What is a Web Service in .NET?

A web service is a software component that exposes itself through the open communication channels of the Internet. Applications running on remote machines, on potentially different platforms, can access these components in a language and platform-independent manner. A Web Service is a group of functions, packaged together for use in a common framework throughout a network.

There are 4 types of authentications


1.WINDOWS AUTHENTICATION
2.FORMS AUTHENTICATION
3.PASSPORT AUTHENTICATION
4.NONE/CUSTOM AUTHENTICATION

The authentication option for the ASP.NET application is specified by using the tag in the Web.config file, as shown below:
other authentication options
1. WINDOWS AUTHENTICATION Schemes
  • Integrated Windows authentication
  • Basic and basic with SSL authentication
  • Digest authentication
  • Client Certificate authentication


2. FORMS AUTHENTICATION
You, as a Web application developer, are supposed to develop the Web page and authenticate the user by checking the provided user ID and password against some user database

3.PASSPORT AUTHENTICATION
A centralized service provided by Microsoft, offers a single logon point for clients. Unauthenticated users are redirected to the Passport site

4 NONE/CUSTOM AUTHENTICATION:
If we don’t want ASP.NET to perform any authentication, we can set the authentication mode to “none”. The reason behind this decision could be: We don’t want to authenticate our users, and our Web site is open for all to use. We want to provide our own custom authentication

Monday, December 24, 2007

Interview questions from Accenture, Microsoft

Accenture  Technical  .NET
  1. Difference between asp and asp.net
  1. How do you do exception management
  2. If you are using components in your application, how
  3. can you handle exceptions raised in a component
  4. Can we throw exception from catch block
  5. How do you relate an aspx page with its code behind
  6. page
  7. What are the types of assemblies and where can u
  8. store them and how
  9. What is difference between value and reference types
  10. Is array reference type / value type
  11. Is string reference type / value type
  12. What is web.config. How many web.config files can be
  13. allowed to use in an application
  14. What is differnce between machine.config and
  15. web.config
  16. What is shared and private assembly
  17. What are asynchronous callbacks
  18. How to write unmanaged code and how to identify
  19. whether the code is managed / unmanaged.
  20. How to authenticate users using web.config
  21. What is strong name and which tool is used for this
  22. What is gacutil.exe. Where do we store assemblies
  23. Should sn.exe be used before gacutil.exe
  24. What does assemblyinfo.cs file consists of
  25. What is boxing and unboxing
  26. Types of authentications in ASP.NET
  27. difference between Trace and Debug
  28. Difference between Dataset and DataReader
  29. What is custom tag in web.config
  30. How do you define authentication in web.Config
  31. What is sequence of code in retrieving data from
  32. database
  33. About DTS package
  34. What provider ADO.net use by default
  35. Where does web.config info stored? Will this be
  36. stored in the registry?
  37. How do you register the dotnet component or
  38. assembly?
  39. Difference between asp and asp.net
  40. Whis is stateless asp or asp.net?
  41. Authentication mechanism in dotnet
  42. State management in asp.net
  43. Types of values mode can hold session state in
web.config
  1. About WebService
  2. What are Http handler
  3. What is view state and how this can be done and was this there in asp?
  4. Types of optimization and name a few and how do u
- About DataAdapters - Features of a dataset
  1. How do you do role based security
  2. Difference between Response.Expires and Expires.Absolute
  3. Types of object in asp
  4. About duration in caching technique
  5. Types of configuration files and ther differences
  6. Difference between ADO and ADO.net
  7. About Postback - If you are calling three SPs from a window application how do u check for the performance of the SPS
 Database
    1. What is normalization
    2. What is an index and types of indexes. How many number of indexes can be used per table
    3. What is a constraint. Types of constraints
    4. What are code pages
    5. What is referential integrity
    6. What is a trigger
    7. What are different types of joins
    8. What is a self join
    9. Authentication mechanisms in Sql Server
    10. What are user defined stored procedures.
    11. What is INSTEAD OF trigger
    12. Difference between SQL server 7.0 and 2000
    13. How to optimize a query that retrieves data by joining 4 tables
    14. Usage of DTS
    15. How to disable an index using select query
    16. Is non-clustered index faster than clustered index
    17. Types of optimization in querries
    18. Difference between ISQL and OSQL
    19. How you log an exception directly into sql server what is used for this
    20. About Replication in Database
    21. What is the default optimization done in oracle and sql server
    22. How can i make a coulmn as unique
    23. How many no of tables can be joined in same sql server
    24. How many coulmns can exist per table
    25. About Sql Profiler usage
 HR & Project
1. About yourself
2. About work experience
3. How long you are working on .NET
4. Are you willing to relocate
5. When will you join
6. Why do u what to change from current organization
7. Why do you want to join Accenture
8. What are your weaknesses / areas of improvement
9. What is your current project and your responsibilities
10. Have you done database design / development
11. What is D in ACID
 Microsoft  HR (Screening)
    1. Tell about yourself
    2. Tell about your work experience
    3. Tell about projects
    4. Tell about your current project and your role in it
    5. What is your current salary p.a.
 Technical  .NET
i. How do you manage session in ASP and ASP.NET
ii. How do you handle session management in ASP.NET and how do you implement them. How do you handle in case of SQL Server mode.
iii. What are different authentication types. How do you retrieve user id in case of windows authentication
iv. For a server control, you need to have same properties like color maxlength, size, and allowed character throughout the application. How do you handle this.
v. What is custom control. What is the difference between custom control and user control
vi. What is the syntax for datagrid and specifying columns
vii. How do you add a javascript function for a link button in a datagrid.
viii. Does C# supports multi-dimensional arrays
ix. How to transpose rows into columns and columns into rows in a multi-dimensional array
x. What are object oriented concepts
xi. How do you create multiple inheritance in C#
xii. ADO and ADO.NET differences
xiii. Features and disadvantages of dataset
xiv. What is the difference between and ActiveX dll and control
xv. How do you perform validations
xvi. What is reflection and disadvantages of reflection
xvii. What is boxing and how it is done internally
xviii. Types of authentications in IIS
xix. What are the security issues if we send a query from the application
xx. Difference between ByVal and ByRef
xxi. Disadvantages of COM components
xxii. How do we invoke queries from the application
xxiii. What is the provider and namespaces being used to access oracle database
xxiv. How do you load XML document and perform validation of the document
xxv. How do you access elements in XML document
xxvi. What is ODP.NET
xxvii. Types of session management in ASP.NET
xxviii. Difference between datareader and dataset
xxix. What are the steps in connecting to database
xxx. How do you register a .NET assembly
xxxi. Usage of web.config
xxxii. About remoting and web services. Difference between them
xxxiii. Caching techniques in .NET
xxxiv. About CLS and CTS
xxxv. Is overloading possible in web services
xxxvi. Difference between .NET and previous version
xxxvii. Types of chaching. How to implement caching
xxxviii. Features in ASP.NET
xxxix. How do you do validations. Whether client-side or server-side validations are better
xl. How do you implement multiple inheritance in .NET
xli. Difference between multi-level and multiple inheritance
xlii. Difference between dataset and datareader
xliii. What are runtime hosts
xliv. What is an application domain
xlv. What is viewstate
xlvi. About CLR, reflection and assemblies
xlvii. Difference between .NET components and COM components
xlviii. What does assemblyinfo.cs consists
xlix. Types of objects in ASP
 Database
    1. What are the blocks in stored procedure
    2. How do you handle exceptions. Give the syntax for it
    3. What is normalization and types of normalization
    4. When would you denormalize
    5. Difference between a query and strored procedure
    6. What is clustered and non-clustered indexes
    7. Types of joins
    8. How do you get all records from 2 tables. Which join do you use
    9. Types of optimization
    10. Difference between inline query and stored procedure
 Project related
i. Tell about your current project
ii. Tell about your role
iii. What is the toughest situation you faced in the development
iv. How often you communicate with the client
v. For what purposes, you communicate with the client - What is the process followed
vi. Explain complete process followed for the development
vii. What is the life cycle model used for the development
viii. How do communicate with team members
ix. How do you say you are having excellent team management skills
x. If your client gives a change and asks for early delivery. How will you manage.
xi. -How will gather requirements and where do you record. Is it in word / Excel or do you have any tool for that
xii. What is the stage when code is delivered to the client and he is testing it.
xiii. What are the different phases of SDLC
xiv. How do you handle change requests
xv. How do you perform impact analysis
xvi. How do you write unit test cases.
xvii. About current project architecture
 Keane on 12th October 2003  Technical  .NET
- Write steps of retrieving data using ado.net
- Call a stored procedure from ado.net and pass parameter to it
- Different type of validation controls in asp.net
- Difference between server.Execute and response.redirect
- What is Response.Flush method
- How Response.flush works in server.Execute
- What is the need of clinet side and server side validation
- Tell About Global.asax
- What is application variable and when it is initialized
- Tell About Web.config
- Can we write one page in c# and other in vb in one application
- When web.config is called
- How many web.config a application can have
- How do you set language in web.cofig
 Database
    1. How do you rate yourrself in oracle and sql server
    2. What is E-R diagram
    3. Draw E-R diagram for many to many relationship
    4. Design databaseraw er diagram for a certain scenario(many author many books)
    5. Diff between primary key and unique key
    6. What is Normalization
    7. Difference between sub query and nested query
    8. Indexes in oracle
    9. Querry to retrieve record for a many to many relationship
    10. Querry to get max and second max in oracle in one querry
  1. Write a simple Store procedure and pass parameter to it
 Digital Globalsoft  Technical  .NET
- Difference between VB dll and assemblies in .NET
- What is machine.config and web.config
- Tell about WSDL
- About web methods and its various attributes
- What is manifest
- Types of caching
- What does connection string consists of
- Where do you store connection string
- What is the difference between session state and session variables
- How do you pass session values from one page to another
- What are WSDL ports
- What is dataset and tell about its features. What are equivalent methods of previous, next etc. Of ADO in ADO.NET
- What is abstract class
- What is difference between interface inheritance and class inheritance
- What are the collection classes
- Which namespace is used for encryption
- What are the various authentication mechanisms inASP.NET
- What is the difference between authentication and autherization
- What are the types of threading models
- How do you send an XML document from client to server
- How do you create dlls in .NET
- What is inetermediate language in .NET
- What is CLR and how it generates native code
- Can we store PROGID informatoin in database and dynamically load the component
- Is VB.NET object oriented? What are the inheritances does VB.NET support.
    1. What is strong name and what is the need of it
    2. Any disadvantages in Dataset and in reflection
    3. Advantage of vb.net over vb
    4. What is runtime host
    5. How to send a DataReader as a parameter to a remote client
    6. How do you consume a webservice
    7. What happens when a reference to webservice is added
    8. How do you reference to a private & shared assembly
    9. What is the purpose of System.EnterpriseServices namespace
    10. About .Net remoting
    11. Difference between remoting and webservice
    12. Types of statemanagement techniques
    13. How to register a shared assembly
    14. About stateless and statefull webservice
    15. How to invoke .net components from com components,give the sequence
    16. How to check null values in dataset
    17. About how soap messages are sent and received in webservice
    18. Error handling and how this is done
    19. Features in .net framework 1.1
    20. Any problem found in vs.net
    21. Optimization technique description
    22. About disco and uddi
    23. What providers does ado.net uses internally
    24. Oops concepts
    25. Disadvantages of vb
    26. XML serialization
    27. What providers do you use to connect to oracle database?
 Database
- Types of joins
 General
- What are various life cycle model in S/W development
 Infosys  Technical  .NET
    1. How do you rate yourself in .NET
    2. What is caching and types of caching
    3. What does VS.NET contains
    4. What is JIT, what are types of JITS and their pupose
    5. What is SOAP, UDDI and WSDL
    6. What is dataset
 Database
- How do you optimize SQL queries
 General
- Tell about yourself and job
- Tell about current project
- What are sequence diagrams, collaboration diagrams and difference between them
- What is your role in the current project and what kinds of responsibilites you are handling
- What is the team size and how do you ensure quality of code
- What is the S/W model used in the project. What are the optimization techniques used. Give examples.
- What are the SDLC phases you have invloved
 Satyam  Technical  .NET
- Types of threading models in VB.net
- Types of compatability in VB and their usage
- Difference between CDATA and PCDATA in XML
- What is Assync in XML api which version of XML parser u worked with
- Types of ASP objects
- Difference between application and session
- What is web application virtual directory
- Can two web application share a session and application variable
- If i have a page where i create an instance of a dll and without invoking any method can I send values to next page
- Diffeernce between Active Exe and /Dll
- Can the dictionary object be created in client's ccope?
- About MTS and it's purpose
- About writting a query and SP which is better
- I have a component with 3 parameter and deployed to client side now i changed my dll method which takes 4 parameter.How can i deploy this without affecting the
clent's code
- How do you do multithreading application in VB
- About Global .asax
- Connection pooling in MTS
- If cookies is disabled in clinet browser willsession work
- About XLST
- How do you attach an XSL to an XML in presenting output
- What is XML
- How do you make your site SSL enabled
- Did you work on IIS adminisdtration
 Database- dd  General- dd  HR
- About educational background
- About work experience
- About area of work
- Current salary, why are looking for a change and
about notice period
- About company strength, verticals, clients, domains
- Rate yourself in different areas of .NET and SQL
 Cognizant  Technical  .NET
- About response.buffer and repsonse.flush
- About dataset and data mining
- About SOAP
- Usage of htmlencode and urlencode
- Usage of server variables
- How to find the client browser type
- How do you trap errors in ASP and how do you invoke a component in ASP
 Database
- About types of indexes in SQL server
- Difference between writing SQL query and stored procedure
- About DTS usage
- How do you optimize Sql queries
 General
- Dfs
- Rate yourself in .NET and SQL
- About 5 processes
- About current project and your role
 HR
- About educational background, work experience, and area of work
 TCS  Technical  .NET
    1. Define .NET architecture
    2. Where does ADO.NET and XML web services come in the architecture
    3. What is MSIL code
    4. Types of JIT and what is econo-JIT
    5. What is CTS, CLS and CLR
    6. Uses of CLR
    7. Difference between ASP and ASP.NET
    8. What are webservices, its attributes. Where they are available
    9. What is UDDI and how to register a web service
    10. Without UDDI, is it possible to access a remote web service
    11. How a web service is exposed to outside world
    12. What is boxing and unboxing
    13. What is WSDL and disco file
    14. What is web.config and machine.config
    15. What is difference between ASP and ASP.NET
    16. What is dataset and uses of dataset
    17. What does ADO.NET consists of?
    18. What are various authentication mechanisms in ASP.NET
- What do you mean by passport authentication and windows authentication
- What is an assembly and what does manifest consists
- What is strong name and what is the purpose of strong name
- What are various types of assemblies
- Difference between VB.NET and C#. Which is faster
    1. Types of caching
    2. How WSDL is stored
    3. What is the key feature of ADO.NET compared to ADO
    4. How does dataset acts in a disconnected fashion
    5. Does the following statement executes successfully:
  1. Response.Write("value of i = " + i);
    1. What is ODP.NET
    2. What are the providers available with VS.NET
    3. What is a process
    4. What is binding in web service
    5. How a proxy is generated for a web service
    6. About delegates
- What are static assemblies and dynamic assemlies. Differences between them
 Database
- What are the types of triggers
- Types of locks in database
- Types of indexes. What is the default key created
when a primary key is created in a table
- What is clustered, non-clustured and unique index.
How many indexes can be created on a table
- Can we create non-clustured index on a clustered index
- Types of backups
- What is INSTEAD OF trigger
- What is difference between triggers and stored procedures. And advantages of SP over triggers
- What is DTS and purpose of DTS
- Write a query to get 2nd maximum salary in an employee table
- Types of joins.
- What is currency type in database
- What are nested triggers
- What is a heap related to database
 General  HR
- About yourdelf
- About procsses followed
- Notice period
- Appraisal process
- What is SOAP and why it is required
- About effort estimation
- Whether salary negotiable
- Why are looking for a change
- How fo you appraise a person
- Do you think CMM process takes time
- About peer reviews
- How do you communicate with TL / PM / Onsite team
 DELL  Technical  .NET
    1. Any disadvantages in Dataset and in reflection
    2. Difference between Active Exe and Activex dll
    3. Can we make activex dll also ti execute in some process as that of client ? How can we do?
    4. Types of compatabilities and explain them
    5. Types of instancing properties and explain each.
  1. Tell the difference between multiuse,singleuse and globalmultiuse and which is default
    1. What is assembly?
    2. Difference between COM and .NET component
    3. What is early binding and Late binding. Difference which is better
    4. What happens when we instantiate a COM component
    5. What happens when we instantiate a .NET component
    6. Are you aware of containment and Aggregation
    7. What is UUID and GUID what is the size of this ID?
    8. About Iunknown interface Queue ,its methods Querry Interface Addref,Release and Explane each
    9. What 'll u do in early and late binding
    10. In early binding will the method invoked on com component will verify it's existance in the system or not?
    11. Difference between dynamic query and static query
    12. About performance issues on retrieving records
    13. About ADO and its objects
    14. What is unmannaged code and will CLR handle this kind of code or not .
    15. Garbage collector's functionality on unmanaged code
    16. If Instancing = Single use for ActiveX Exe, how will this be executed if there are 2 consecutive client requests ?
    17. Threading Types.
    18. How about the security in Activex DLL and Activex EXE
 Database
    1. Types of cursors and explanation each of them
    2. Types of cursor locations and explanation on each of them
    3. Types of cursor locks and explanation each of them
    4. How do you retrieve set of records from database server.{Set max records = 100 & use paging where pager page no or records = 10 & after displaying 100 records again connect to database retrieve next 100 }
 HR & Project
1. Rate yourself in vb and com
2. Whether I have any specific technology in mind to work on.
 MMTTS  Technical  .NET
  1. About .NET Framework
  2. About Assembly in .NET, types of assemblies, their difference, How to register into GAC. How to generate the strong names & its use.
  3. What is side by side Execution?
  4. What is serialization?
  5. Life cycle of ASP.NET page when a request is made. - If there is submit button in a from tell us the sequence what happens if submit is clicked and in form action is specified as some other page.
  6. About a class access specifiers and method access specifiers.
  7. What is overloading and how can this be done.
  8. How to you declare connection strings and how to you make use of web.config.
  9. How many web.copnfig can exists in a web application & which will be used.
  10. About .NET Remoting and types of remoting
  11. About Virtual functions and their use.
  12. How do you implement Inheritance in dot net
  13. About ado.net components/objects.Usage of data adapters and tell the steps to retrieve data.
  14. What does CLR do as soon as an assembly is created
  15. How do you retrieve information from web.config.
  16. How do you declare delegates and are delegates and events one and the same and explain how do you declare delegates and invoke them.
  17. If I want to override a method 1 of class A and in class b then how do you declare?
  18. What does CLR do after the IL is generated andmachine language is generated .Will it look for main method
  19. About friend and Protected friend
  20. About multi level and multiple inheritance how to achieve in .net
  21. Sequence to connect and retrieve data from database using dataset
  22. About sn.exe
  23. What was the problem in traditional component why side by side execution is supported in .net
  24. How .net assemblies are registred as private and shared assembly
  25. All kind of access specifiers for a class and for methods
  26. On ODP.net
  27. Types of assemblies that can be created in dotnet
  28. About namespaces
  29. OOPs concept
  30. More on CLR
 HR & Project
    1. About yourself
    2. About the current employer
    3. About expertise
    4. What type of job you are expecting
    5. What is current and expected is it negotiable
    6. Can you justify why r you expecting more in professional terms
    7. What are you looking for in Dell
. NET FAQ
1. What is .NET Framework?
Is a collection of Services and classes, .NET Framework exists as a layer between the application and the underlying operating system.
When you compile the code from any language that supports the .NET Framework, it compiles into something called MSIL, or Microsoft Intermediate Language. This MSIL file is binary, but it is not
machine code; instead, it is a format that is platform independent and can be placed on any machine running the .NET Framework. Within the .NET Framework is a compiler called the Just-In-Time, or JIT, compiler. It compiles the MSIL down to machine code specific to that hardware and operating system.
2. What is the CLR?
One of the Major components of the .NET Framework is the CLR- it is Runtime for the .NET. It provides a) Security b) debugging c) Exception Handling d) Versioning
3. Describe the Managed Execution Process.
When you compile the code from any language that supports the .NET Framework it compiles into something called IL, which is in Binary format [ this can be called as Managed code. Managed code contains METADATA] it can be called as PE file.
PE stands for Potable/ Physical Executable file. When you try to execute this file using CLR it converts the binay to Machine/Native Code by using JIT (Justin-time Compiler which is an in-builtin tool in CLR). Even the JIT Compiler doesn't compile the entire IL,
when the component is first called. Instead each method is compiled the first time it is called. CLR will look for compiled versions of IL, if the CLR can't find the precompiled version, it begins to JIT Compile it on the fly.
4. What is an Assembly?
An Assembly is a collection of one or more PE(portable/Physical Executable) files. Assemblies are also called as Static Assemblies because you create them and store them on disk. Each Assembly has a manifest that contains the metadata for that assembly, such as the classes, types and references contained in the IL. ** All the runtime applications must be made up of one or more assemblies.
[Assemblies are a fundamental part of programming with the .NET Framework. An assembly performs the following functions: It contains code that the common language runtime executes. Microsoft intermediate language (MSIL) code in a portable executable (PE) file will not be executed if it does not have an associated assembly manifest. Note that each assembly can have only one entry point (that is, DllMain, WinMain, or Main). It forms a security boundary.
An assembly is the unit at which permissions are requested and granted. It forms a type boundary. Every type's identity includes the name of the assembly in which it resides. A type called MyType loaded in the scope of one assembly is not the same as a type called MyType loaded in the scope of another assembly.It forms a reference scope boundary. The assembly's manifest contains assembly metadata that is used for resolving types and satisfying resource requests. It specifies the types and resources that are exposed outside the assembly. The manifest also enumerates other assemblies on which it depends. It forms a version boundary. The assembly is the smallest versionable unit in the common language runtime; all types and resources in the same assembly are versioned as a unit. The assembly's manifest describes the version dependencies you specify for any dependent assemblies. For more information about versioning, see Assembly Versioning. It forms a deployment unit. When an application starts, only the assemblies that the application initially calls must be present. Other assemblies, such as localization resources or assemblies containing utility classes, can be retrieved on demand. This allows applications to be kept simple and thin when first downloaded. For more information aboutdeploying assemblies, see Deploying Applications. It is the unit at which side-by-side execution is supported. For more information about running multiple versions of the same assembly, see Side-by-SideExecution. Assemblies can be static or dynamic. Static assembliescan include .NET Framework types (interfaces and classes), as well as resources for the assembly (bitmaps, JPEG files, resource files, and so on). Static assemblies are stored on disk in PE files. Youcan also use the .NET Framework to create dynamic assemblies, which are run directly from memory and are not saved to disk before execution. You can save dynamic assemblies to disk after they have executed. There are several ways to create assemblies. You can use development tools, such as Visual Studio .NET, that you have used in the past to create .dll or .exe files. You can use tools provided in the .NET Framework SDK to create assemblies with modules created in other development environments. You can also use common language runtime APIs, such as Reflection.Emit, to create dynamic assemblies.] .NET Assemblies & Manifests The concept of components has been around for many years, the idea is to divide ur code into smaller units of manageable units which exhibits some known behaviour and then integrate your application with the help of these components rather than make one huge monolithic block of code. The idea was to implement code reuse and version control of the code. With .NET, Microsoft has tried to retain the benefits of COM while addressing the accompanying problems withthe same. These complexities and problems have been addressed by returning to the concept of Class in , for e.g C++ . So a simple C# component can be viewed as a C# class , but with the benefit of being easy to
call a method of that class across a DLL and language boundaries. So if you want to create a .NET component , you just write a .NET class and adhere to some guidelines laid down by Microsoft.
They can be summarized as follows. CLS Compliant : Microsoft has laid down a common language specification which is a set of facilities that any 3rd party compiler that tagets .NET must support. Hence .NET components must use only features in their methods and properties that are defined in the CLS. This ensures that any compiler which is able to compile a particular piece of code, will make full use of the component. Public Access: The classes inside your component should be marked as Public rather than as Private which allows the outside world to interact with it. If it is marked private, nothing outside the component can access these classes which, of course restricts its usefulness as a component. System.ComponentModel.Component: The classes should inherit from the System.Component.ComponentModel or implement the IComponent Interface. This adds a few methods to your classes which enable code sharing. Naming Conventions: The guidelines for the naming your classes, methods anf properties are laid down by Microsoft. These full guidelines can be found in the MSDN documentation for .NET. .NET Assemblies A .NET component is now known as an Assembly. An assembly is an atomic unit and is self-describing i.e , it doesn't just contain the code but also it's meta data. This meta data is contained in a data structure called Manifests.With a DLL , the manifest is incorporated with the code itself, this is known as a single file assembly. Multi file assembly can also be created where the manifest exists as a stand alone entity within the assembly or as one of the modules in the assembly.
The Manifest contains the following :
The identity of the assembly which consists of it's name,version and culture. A Shared Name if it is a shared assembly. Names of all the files in the assembly. A encrypted hash of all the files in the assembly. This hash is used to detect all the changes that occur with the files in the assembly. Details of all the classes, methods and properties , i.e whether they are public, private, protected etc. Names and hashes of all the assemblies that the current assembly references. Security Details The manifest serves the same purpose as the type library does with COM. The difference is that the manifest contains more information than the type library and it is directly packaged with the code which allows them to be in sync with each other at all times.
Assembly Types Assemblies can be of two types :
Shared Private
By default , when an assembly is created, it is a Private Assembly i.e the assembly is intended only for one application. The files of that assembly must be placed in the same folder as the application or in a sub folder. No other application will be able to make a call to this assembly. The advantage of having an private assembly is that , it makes naming the assembly very easy, since the developer need not worry about name clashes with other assemblies. As long as the assembly has a unique name within the concerned application, there won't be any problems. If a private assembly is to be accessed by more than one application, then the files of the assembly has to be placed seperately within the folders of each application which needs to access the assembly. If the assembly is to be made into a Shared Assembly, then the naming conventions are very strict since it has to be unique across the entire system. The naming conventions should also take care of newer versions of the component being shipped. These is accomplished by giving the assembly a Shared Name. Then the assembly is placed in the global assembly cache which is a folder in the file system reserved for shared assemblies. There are a lot of utilities available which can convert private assemblies into sharedassemblies. It can't be done at compile time.
Advantages of Assemblies
With earlier component architectures like COM , the components had to be registered in the system registry which gave the benefit that it was easily to identify the components on a particular system. But with time, several disadvantages have been seen with this approach. Firstly it made the task of installing software very complex. Then , if the COM component is to be used across the network, there has to be a entry in the registry of each machine that the component has to be called from. Then, of course there is the problem of the DLL HELL, which occurs when the application stops working because of the compatibility problems in the different versions of the component. These were the issues that Microsoft attempted to tackle when they designed Assemblies. With Assemblies, there is no need for registry entries. Since assemblies are self describing, so the information does not have to be maintained else where. Hence the process of installing a component is simply copying the assembly file in the application folder. But then there is no centralized record of all the components which was the motive of maintaining the information in the registry. With private assemblies, there is no need to keep a entralized record since these assemblies were not meant to be used publicly or shared between applications. With Shared assemblies, all the components are kept in a single folder on the system, so getting the information of all the shared assemblies on a system is as simple as seeing the contents of a folder.
Creating multi file assemblies reduces the working set of the application when it is being called which helps in performance improvement because the .NET runtime loads only the required modules.
With Shared Assemblies, the problem of DLL HELL is also solved because the assembly is identified not only by it's name but also it's version number hence it is possible to have an assembly of different versions lying in the assembly cache. When the client calls a assembly, it indicates the name and the version number of the same so there is no problems on the call being relayed to the right assembly. The versioning and the simultaneous installs of multiple versions apply only to Shared assemblies and not private assemblies since there is no point in having multiple versions of a private assembly which is being called on only by a single application.
5. What is the Global Assembly Cache?
If you want to use an Assembly for multiple applications you need to use GAC. GAC is the place where we keep the components in one
location to provide access to multiple applications.CLR has two caches: 1) Download Cache 2) GAC
If an assembly is not in the local directory and notin the GAC, you can have a codebase hint in the configuration file. The CLR then downloads the assembly, storing it in the download cache and binding to it from there.
6. Describe Application Domains
Operating systems and runtime environments typically provide some form of isolation between applications. This isolation is necessary to ensure that code running in one application cannot adversely affect other, unrelated applications.Application domains provide a secure and versatile unit of processing that the common language runtime can use to provide isolation between applications. Application domains are typically created by runtime hosts, which are responsible for bootstrapping the common language runtime before an application is run.
7. Write a program to access a SQL Database Using ADO.Net
8. Write a Hello World WinForms App
9. Explain Threading and Write a Small Threading App
Each application that is executed has its own 'process space' in the operating system. A Process is an isolated area of memory specifically set aside for that application to be executed in. A Thread on the other hand is a single unit that executes within a process and more specifically by which the operating system allocates processor time. A process will always have at least one thread running in it but it ispossible for a process to contain multiple threads that execute simultaneously.Say, for example that you have written a single threaded email client application. This application has only one thread running in its process. When you perform a lengthly operation, such as a 'Send and Receive', because the thread is managing the user interface as well as all the other code, the user has to wait for that operation to complete before they are given back the focus to the user interface. If it were written as a multi threaded application,the 'Send and Receive' operation could be fired off an a new thread. This would mean that the first thread, that is running the user interface, would still have the focus for the user to interact with as both threads will be running at the same time. A real life example of this is in Microsoft Outlook. When you click 'Send and Receive' a new thread is started to perform this operation. This allows you to continue to do other things such as compose a new
email or view your calendar. Using threads in this way is an extremely powerful technique. It allows the application to make the best use of the processor's time by running threads in the background in between the application's events.
When to use Threading?
Using multiple threads in your application may sound like a dream come true and can bring a gread deal of extra functionality. But, like everything, there is always a cost and in designing your application it is wise to consider the pros and cons of using multiple threads and to know when to use them and when not to. As we mentioned before, multiple threads can add responsiveness to your application and can save some by processing code simultaneously. If you are going to be doing networking in your application, ie client/server, database, web server etc then it would be a good idea to implement multiple threads as the time taken for network operations to complete can vary
to a large degree. Also, if you are going to perform an operation that will take time to complete, like our email application explained earlier or you want to run specific tasks separate to your main user interface, then multiple threads will no doubt help you out. However, each thread you create will take up resources and time on the operating system. A common rule is always to use as few threads as possible. Because multiple threads run simultaneously, the processor has to switch between each thread so that each one can be executed. The processor will move from one to the next in a kind of round-robin fashion. Each time it moves from a thread, it has to take a snapshot of it so that when it returns to it, it can continue where it left off. Needless to say, this takes time. So if you are creating threads unnecessarily then you will be wasting a lot of the processor's time.
10. Write a program to access a SQL Database Using
ADO.Net in ASP.NET and use the appropriate DataGrid Control
11. What is the Global ASA(X) File?
The Global.asax file, also known as the ASP.NETapplication file, is an optional file that contains code for responding to application-level events raised by ASP.NET or by HTTP modules. The Global.asax file resides in the root directory of an ASP.NET-based application. At run time, Global.asax is parsed and compiled into a dynamically generated .NET Framework class derived from the HttpApplication base class. The
Global.asax file itself is configured so that any direct URL request for it is automatically rejected; external users cannot download or view the code written within it.
The ASP.NET Global.asax file can co-exist with the ASP Global.asa file. You can create a Global.asax file either in a WYSIWYG designer, in Notepad, or as a compiled class that you deploy in your application's \bin directory as an assembly. However, in the latter case, you still need a Global.asax file that refers to the assembly. The Global.asax file is optional. If you do not define the file, the ASP.NET page framework assumes that you have not defined any application or session event handlers. When you save changes to an active Global.asax file,the ASP.NET page framework detects that the file has been changed. It completes all current requests for the application, sends the Application_OnEnd event to any listeners, and restarts the application domain. In effect, this reboots the application, closing all browser sessions and flushing all state information. When the next incoming request from a browser arrives, the ASP.NET page framework re-parses and recompilesthe Global.asax file and raises the Application_OnStart event.
12. Explain State Management in ASP (and ASP.Net) (App, Session)
Client-Based State Management Options:
1) View state 2) Hidden fields 3) Cookies 4) QueryStrings
view state that automatically preserves property values of the page and all the controls on it between round trips.
View State The Control.ViewState property provides a dictionary object for retaining values between multiple requests for the same page. This is the method that the page uses to preserve page and control property values between round trips. When the page is processed, the current state of the page and controls is hashed into a string and saved in the page as a hidden field. When the page is posted back to the server, the page parses the view state
string at page initialization and restores property information in the page. You can store values in view state as well. For details, see Saving Web Forms Page Values Using View State. For recommendations on when to use view state, see State Management Recommendations.
Server-Based State Management Options:
1) Application State 2) Session State 3) Database support( linked with cookies)
* See page 28 for full details:
13. Explain ASP.NET Caching
Caching is a technique widely used in computing to increase performance by keeping frequently accessed or expensive data in memory. In the context of a Web application, caching is used to retain pages or data across HTTP requests and reuse them without the expense of recreating them. ASP.NET has three kinds of caching that can be used by
Web applications: Output caching, which caches the dynamic response generated by a request. Fragment caching, which caches portions of a response generated by a request. Data caching, which caches arbitrary, objects programmatically. To support this, ASP.NET provides a full-featured cache engine that allows programmers to easily retain data across requests. Output caching is useful when the contents of an entire page can be cached. On a heavily accessed site, caching frequently accessed pages for even a minute at a time can result in substantial throughput gains. While a page is cached by the output cache, subsequent requests for that page are served from the output page without executing the code that created it. Sometimes it is not practical to cache an entire page - perhaps portions of the page must be created or customized for each request. In this case, it is often worthwhile to identify objects or data that areexpensive to construct and are eligible for caching.Once these items are identified, they can be created once and then cached for some period of time.Additionally, fragment caching can be used to cache regions of a page's output. Choosing the time to cache an item can be an interesting decision. For some items, the data might be refreshed at regular intervals or the data is valid for a certain amount of time. In that case, the cache items can be given an expiration policy that causesthem to be removed from the cache when they have expired. Code that accesses the cache item simply checks for the absence of the item and recreates it,if necessary.The ASP.NET cache supports file and cache key dependencies, allowing developers to make a cache item dependent on an external file or another cache item. This technique can be used to invalidate items when their underlying data sourcechanges.
14. What is a Web Service?
XML Web services are the fundamental building blocks in the move to distributed computing on the Internet. Open standards and the focus on communication and collaboration among people and applications have created an environment where XML Web services are becoming the platform for application integration. Applications are constructed using multiple XML Web services from various sources that work together
regardless of where they reside or how they were implemented.
15. Build a Web Service in ASP.NET (C#) and Consume It
16. What is SOAP and how does it relate to XML?
SOAP :Soap is the communications protocol for XML Web services. When SOAP is described as a communications protocol, most people think of DCOM or CORBA and start asking things like, "How does SOAP do object activation?" or "What naming service does SOAP use?" While a SOAP implementation will probably include these things, the SOAP standard doesn't specify them. SOAP is a specification that defines the XML format for messages-and that's about it for the required parts of the spec. If you have a well-formed XML fragment enclosed in a couple of SOAP elements, you have a SOAP message. Simple isn't it?
17. Explain the CTS
The formal specification of the type system implemented by the common language runtime is called the Common Type System (CTS). The CTS specifies how object classes (called types) are defined. For example, the CTS allows a class type to contain zero or more members. The following is the list of possible members: Field A data variable that is part of the object's state. Fields are identified by their name and type. Method A function that performs an operation on the object, usually changing the object's state. Methods have a name, signature, and modifiers. The signature specifies the calling convention, number of parameters (and their sequence), the types of the parameters, and the type of value returned by the method. The modifiers can include custom attributes, whether the method is public, private, static, and so on. Property To the caller, this member looks like a field. But to the class implementor, this member looks
like a method. Properties allow an implementor to calculate a value only when necessary and allow a class user to have simplified syntax. Properties also allow you to create read-only or write-only "fields."Event Events provide a notification mechanism between an object and other interested objects. For example, a button could offer an event that notifies other objects when the button is clicked.
The CTS also specifies the rules for type visibility and for access to the members of a type. Types are either visible outside of the assembly, to clients of the assembly, or they are visible only tocode within the same assembly. Marking a type as public enables it to be visible (exported) outside of the assembly. Thus, the CTS establishes the rules by which assemblies form a boundary of visibility for a type and its methods, and the common language runtime enforces the visibility rules. Regardless of whether a type is visible to a caller, the type gets to control whether the caller has access to its members. Figure 3 shows the valid options for controlling access to a method or field.
In addition, the CTS defines the rules governing type inheritance, virtual functions, object lifetime, and so on. These rules have been designed to accommodate the semantics expressible in the languages you use today. In fact, you won't even need to learn the CTS rules per se, as the language you choose will expose its own language syntax and type rules in the same way you are familiar with, and will map this language-specific syntax into the syntax of the common language runtime when it emits the PE file.
18. What is boxing/unboxing
Boxing and unboxing is a essential concept in C#'s type system. With Boxing and unboxing one can link between value-types and reference-types by allowing any value of a value-type to be converted to and from type object. Boxing and unboxing enables a unified view of the type system wherein a value of any type can ultimately be treated as an object. The conversion of a value type instance to an object, which implies that the instance will carry full type information at run time and will be allocated in the heap. The Microsoft intermediate language (MSIL) instruction set's box instruction converts a value
type to an object by making a copy of the value type and embedding it in a newly allocated object.
19. what is an assembly manifest ( refer 4th Question)
20. What is the key difference between the manifest of
a private vs shared assembly ( refer 4th Question)
21. Write code to convert a string to byte array in
C#/VB.Net
22. whats a wsdl file
WSDL (often pronounced whiz-dull) stands for Web Services Description Language. For our purposes, we can say that a WSDL file is an XML document that describes a set of SOAP messages and how the messages are exchanged. In other words, WSDL is to SOAP what IDL is to CORBA or COM. Since WSDL is XML, it is readable and editable but in most cases, it is generated and consumed by software. The Web Services Description Language tool generates code for XML Web services and XML Web service clients from WSDL contract files, XSD schemas, and .discomap discovery documents
23. How does Garbage collection happen in .net
CLR manages references to objects and removes them from memory when all the references are gone, through the process known as garbage collection.
Garbage Collection:
Garbage collection is now being handled by the runtime. In VB6, if you set an object to Nothing , it was destroyed immediately. This is no longer true in VB.NET. Instead, when you set an object to Nothing or it loses all its references, it becomes garbage collectable. It's still in memory, taking up resources. The garbage collector runs on a separate thread, and it passes by occasionally looking for objects to clean up (destroy). This lag is often less than a second, but it could be longer on a system in heavy use. Even though the object has been marked for garbage collection, any resources it has opened are still open, including any data or file locks that it might have obtained. Microsoft calls this "no deterministic finalization" because the developer is no longer truly in control of when the object will be destroyed. The Sub Dispose is called when the object is truly destroyed by the garbage collector. You can call the garbage collector by using the Collect method of the GC class in the System namespace.
24. List some of the language benefits that C# offers
over C++
25. Why do we need namespaces
The .NET Framework class library is comprised of namespaces. Each namespace contains types that you canuse in your program: classes, structures, enumerations, delegates, and interfaces.
26. What are the different JITters available in .net
Jitter Buffers Microsoft(r) DirectPlay(r) Voice features a jitter buffer, an adaptive buffering algorithm that provides optimal voice quality with the least amount of latency.
27. When you compile a simple hello world application;
Are you creating an assembly? Yes
28. What is DLL Hell and how do assemblies deal with it?
One of the great benefits of COM was supposed to be an end to DLL Hell. If you think back for a moment to the days of 16-bit programming, you'll remember that you had to distribute a number of DLLs with a Windows application. It seemed that almost every application had to Install the same few DLLs, such as Ctrl3d2.dll.Each application you installed might have a slightly different version of the DLL, and you ended up with multiple copies of the same DLL, but many were different versions. Even worse, a version of a particular DLL could be placed in the Windows\System directory that then broke many of your existing applications. COM was supposed to fix all that. No longer did applications search around for DLLs by looking in their own directories, and then search the Windows path. With COM, requests for components were sent to the registry. Although there might be multiple versions of the same COM DLL on the machine, there would be only one version in the registry at any time. Therefore, all clients would use the same version. This meant, however, that each new version of the DLL had to guarantee compatibility with previous versions. This led to interfaces being
immutable under COM; after the component was in production, the interface was never supposed to change. In concept that sounds great, but developers released COM components that broke binary compatibility; in other words, their components modified, added, or removed properties and methods. The modified components then broke all existing clients. Many VB developers have struggled with this exact problem. The .NET Framework and the CLR attempt to address this problem through the use of assemblies. Even before .NET, Windows 2000 introduced the capability to have an application look in the local directory for a DLL, instead of going to the registry. This ensured that you always had the correct version of the DLL available to the application.
The runtime carries this further by allowing components to declare dependencies on certain versions of other components. In addition, multiple versions of the same component can be run simultaneously in what Microsoft calls side-by-side instancing or side-by-side execution.
29. Is System.String myString = "Hello, World"; a ref
or a val
ByRef
30. int I = 42; object o = I; Console.WriteLine (I +
", " + (Int32)o);
'- How many boxing/unboxing operations are happening
here 'and where
31. Whats the difference between System.Int32 and
Int32
32. List all the aliases (variable data types) in C#
33. what is an alias
34. What is Xml used for ?
35. what is XSL used for?
Stylesheet for XML Document
36. what is the difference between xml and HTML?
HTML is about displaying information, while XML is about describing information
37. what is XSL:template?
38. What is Manifest
contains the metadata
39. How is C# better than VB.Net
N/A
40. Give a brief on ADO.Net
ActiveX Data Objects[ADO]: ADO has been redesigned and extended for distributed Internet use. Called ADO.NET Previously ADO+), it uses the same access method for local,client-server, or Internet access. ADO can be used for accessing manykinds of data stores. In ADO, data is accessed through an OLE DB provider.
41. What is data adapter is ADO.Net
For pushing data into a DataSet, and reconciling data against a database. A DataAdapter is the object that connects to the database to fill the DataSet. Then, it connects back to the database to update the data there, based on operations performed while the DataSet
held the data
42. Give an idea on Dataset and DataReader
DataSets. For storing, remoting and programming against flat data, XML data and relational data. DataReaders. For reading a forward-only stream of data records from a SQL Server data source.
43. What are various components of WSDL
Web Services Description Language (WSDL):
44. How is threading done in C#
45. What are the various type of Authentications
Forms, Windows, Passport, None
46. Give an idea on Inheritance and Polymorphism
Inheritance : is a mechanism for deriving a new class from an older base class.
Polymorphism: Polymorphism: Polymorphism is the ability to change the implementation of a base class for different objects. For example, if you have a bicycle and a car, both can move, but they do so in very different ways. They use different mechanisms for movement, and the distance that each can move in an hour is significantly different. Yet, both a Car and a Bike class might inherit from a base Transportation class, which could also be used as the basis for a Plane class, a Train class, a HotAirBalloon class, and so on.
In object-oriented programming, polymorphism (from the Greek meaning "having multiple forms") is the characteristic of being able to assign a different meaning or usage to something in different contexts - specifically, to allow an entity such as a variable, a function, or an object to have more than one form
47. What is Web.config file? In what language is it written
web.config is an XML-based configuration file. The root element of a web.config file is always a tag. The tag contains three different types of elements: 1) configuration section handler declarations, 2) configuration section groups, and 3) configuration section settings. Following are the list of commonly used Configuation tags, that, we be used in our web applications and will go thru them
1) Appsettings
2) Authentication
3) Authorization
4) Compilation
5) CustomErrors
6) Globalization
7) Identity
8) MachineKey
9) Pages
10) ProcessModel
11) SessionState
12) Trace
This can be declared at the machine, site, application and subdirectory level Include all the custom settings for your application in this section. Appsettings tag contains two attributes viz; key and value.
Eg:
value="Server=moon;database=Store;Trusted_Connection=yes"
/>
All the authentication/security related stuff are declared in this section. Authentication section contains a single attribute called "mode". Possible values for "mode" are (a) Forms (b) None (c) Passport
and (d) Windows
Form based authentication can be used, if you want to use ASP .NET forms-based authentication. If you want to allow anyonmyous users to access your website, select none. Passpost authentication can be used, if you want the authentication to be based on Microsoft Passport authentication mode.
Use windows mode authentication, if you want to use Basic, Digest, Integrated Windows authentication (NTLM/Kerberos), or certificates
Note: If you are using Form based authentication, then you have several other options such as how the password should be encrypted, while submitting the form, if login fails, which page should be shown to the user etc.
As the AuthenTication is included in, System.Web.Configuration.AuthenticationConfigHandler
while setting the authentication mode, you should code as follows
Eg:


This is a very powerful tag, were you can restrict or allow users who wish to visit your web site. Authorization tag contains two sub tags such as allow and deny. Allow tag provides us with three attributes, namely users, roles and verbs. We can add the list of users seperated by comma in the users attribute. Also we can specify the role in which each user belongs too. Important aspect of the attribute verb is that, we can control users depending upon the web request that the server is getting. The verb attribute provides us with four options GET, HEAD, POST and DEBUG.
Deny tag has the same attributes as the allow tag has.Other aspect of both these tags are, we can use two special symbols ? and * to specify anonymous users and "all users" respectively.
Eg:



It is in this tag, you set all your compilcation options. This tag contains three sub-tags and seven attributes, which are discussed below. Attributes debug specifies whether to compile retail binaries or debug binaries. True specifies debug binaries and False specifies Retail binaries defaultLanguage can be used to specify the language names to use in dynamic compilation files. use explicit attribute to turn on explicit option or to turn off. This takes either true or false, were true means explicit is enabled. We can also do a batch compiliation by specifying the attribute bath as true. If we have batch compiliation,
then we might face the timeout problem. Then we may also want to use the batchTimeout attribute to set the time for batch timeout.
numRecompilesBeforeApprestart is the next attribute. This attribute indicates the number of dynamic recompiles of resources that can occur before the application restarts. This attribute is supported at the global and application level but not at thedirectory level.
Strict attribute indicates the settings of the visual basic strict compile option. supports two values, TRUE and FALSE.
SubTags
Compilers tag contains many or one compiler tag, were we define new compiler options. Assemblies and Namespaces specifies ASP .NET processing directives
Eg:
type="Microsoft.VB. VBCodeProvider,System" />
type="Microsoft.CSharp. CSharpCodeProvider,System" />






As the name says all about, customErros provides information about custom error messages for an ASP.NET application. CustomErrors tag provides us with three attributes.
DefaultRedirect can be used to specify the URL to direct a browser, if any unexpected error occurs. The mode attribute takes three values On, Off or RemoteOnly. Remeteonly specifies that custom errors are shown only to remote clients.
The subtag might be very useful in a varietyof way. We can specify the error status code and ask the browser to redirect to a specific page. We should use the attribute, statusCode to specify the error status code and the redirect attribute to specify the
redirect URL. Eg:
mode="RemoteOnly">



Configures the globalization settings of an application. Two important attributes of this tag are requestEncoding and responseEncoding. Default values for both encoding are "iso-8859-1", which is English.
Eg:
responseEncoding="iso-8859-1">


Controls the application identity of the Web application. Supports three attributes. Impersonate is the first attribute, which specifies whether client impersonation is used on each request to the web server. Takes either TRUE or FALSE. If the impersonation is FALSE, then we should specify the values for the attributes, username and password.
Eg:


Configures keys to use for encryption and decryption of Forms authentication cookie data. This section can be declared at the machine, site, and application levels but not at the subdirectory level. This tag supports three attributes; validationKey, decryptionKey an d validation. ValidationKey and DecryptionKey takes the default
value, which is AutoGenerate. We can also specify a key and it should be length of 128 hexadecimal characters. The validation attribute can be used to specify the alogrithm to be used while encryption. Possible values are SHA1, MD5 and 3DES.
As the name indicates, we should use this tag to specify the page-specific configuration settings. It supports six attributes. We will dicsuss each one of them.
Buffer attribute specifies, whether resources are buffered or not. This takes three values On, Off and Readonly.
We can enable the session state or disable the session by using the attribute, enableSessionState. This takes two values, either TRUE or FALSE.
pageBaseType can be used to specify code-behind class that an .aspx page inherits. userControlBaseType specifies a code behind class that UserControls inherit.
If you want to disable any event firing in the page, you can use the attribute autoEventWireup. This too takes either TRUE or FALSE.
Eg:
autoEventWireup="true">



This section is mainly for the Web Administrators. We should use this tag responsibly. We can use use tag to specify the timeout for when a new worker process should start in place of current one, the idleTimeout which specifies the minutes that ASP .NET automatically shuts down the worker process. One of the important attribute of this tag is requestQueueLimit, were you can specify the number of requests allowed in the queue before ASP .NET begins returning "503" (Server too busy error). Default is 5000.
Eg:
idleTimeout="20" requestQueueLimit="100">



This tag can be used to specify, were we are storing the session. This can be specified in the mode attribute. Supported values mode are Off, InProc, StateServer and SqlServer. InProc indicates that, session states is stored locally. StateServer indicates that session state is stored on a remote server and sqlserver can be used to indicate that the session state is stored on a sql server.
We also have the choice to use cookies to store the sessions. This can be set using the attribute cookieless. Session timeout can be specified using the attribute called timeout. By default, the session timeout is 20 minutes (same as classic ASP).
Eg:
timeout="20">



This is a very useful tag to debug our programs. We can use the trace tag to show all the information for the page processed by the server. By default, all the traces are stored on the server. We can specify the number of traces stored in the memory by using the attribute called requestLimit. Default is 10. We can either append the trace to the page or can be viewed using the trace utility. This is specified by the attribute called pageOutput.
Eg:
pageOutput="true">


There are some more tags available which can be used in the web.config file. Those are , , , , , and . You may want to look into these.
Summary
That was a small introduction for web.config file. And to end with, I have two tips for you.Suppose, if we are creating a new folder and if we want to override the configuration settings of the parent folder, what we have to do is just create another web.config file in the sub-directory. If we need to prevent the overriding of the new web.config
file in the subdirectory, then we can add the attribute allowOverride in the location tag. Also, we can specify the application name in the attribute path.
password="app1pw" />



What if some one types the web.config file in the URL?
ASP.NET configures IIS to prevent direct browser access to web.config files to ensure that their values cannot become public (attempts to access them will cause ASP.NET to return 403: Access Forbidden).
48. How does the code behind in ASP.Net work? And how is it declared in the code
Codebehind is a term referring to code that a web form (or web service or user control or other ASP.NET-handled object) uses that is not specified in the ASPX (or ASMX, ASCX, etc.) file itself. Separating code from the mainly HTML within a web form provides a number of advantages, such as allowing designers to work with the HTML without destroying its page logic, protecting one's source code (though with
the ease of decompilation in .NET, this is minimal protection), and at least for VS.NET users, better support from the IDE
49. What are main advantages of ASP controls over HTML controls
1) The advantages of Web server controls over HTML server controls are:
Web server controls feature a typed object model for cleaner programming and better error checking. 2) They automatically generate correct HTML for both downlevel (HTML 3.2) and uplevel (HTML 4.0) browsers.
For details, see ASP.NET Server Controls and Browser Capabilities.
3) They can be used to build more complex server controls (such as Calendar and DataGrid). ASP.net will ship with five families of Web Controls: Intrinsic controls that map to their HTML equivalents
List controls to provide data flow across a page Rich controls to provide richer UI content and functionality Validation controls to perform a variety of form validation Mobile controls to encapsulate WML
50. What is a well formed document and what is valid document
A Wellformed is a document that conforms to the XML syntax rules. A valid XML document is a Well Formed XML document which also conforms to the rules of a DTD(Document Type Definition).
51. How is XML represented on the HTML page
52. What is delegation
Delegate is commonly defined as a Type Safe Pointer. To better understand a Type-Safe pointer, let's see a how a callback function in C++/VC++ works. The Callback function is normally implemented in the Business tier of a 3-tier architecture (of course there are exceptions to that). Once the Business Logic component implements a particular functionality, say a complex arithmetic calculation, it informs a client that the job was performed successfully. In order to inform the client, it needs an address of the function\method implemented in the client. The address of a function is just a memory address; this address does not carry any information such as number of
parameters, data type of each parameter and its return value. Since the Callback function does not have any idea of the Method Signature it is going to call, in short, it is not Type Safe. However, Delegates provide the feature of Callback functions in a safe way
53. How can we use COM with .Net
we can directly use the COM component in .NET , but problem comes when you want to make that component access to all applications. To use for multiple applications use tlbimp.exe tool to make it compatible
for multiple application access.
54. What is GAC
Global Assembly Cache is a cache for assemblies to be used by multi-ple
applications on the same machine. To add assembliesto, remove assemblies from, or view assemblies in the GAC, use the gacutil.exe console application, provided by the Framework. The GAC is also a directory, so you can add assemblies to the GAC merely by copying them
into the directory.
55. Differences between C++ and C#.
56. What is value type and refernece type in .net?
57. What is WSDL?
58. What is the use of WSDL.exe utility?
59. How you will deploy the assembly into GAC(Global Assembly Cache)?
60. Differneces between DataSet and DataReader?
The DataSet object is central to supporting disconnected, distributed data scenarios with ADO.NET. The DataSet is a memory-resident representation of data that provides a consistent relational programming model regardless of the data source. It can be used
with multiple and differing data sources, used with XML data, or used to manage data local to the application. The DataSet represents a complete set of data including related tables, constraints, and relationships among the tables. ADO.NET DataReader to retrieve a read-only, forward-only stream of data from a database. Using the DataReader can increase application performance and reduce system overhead because only one row at a time is ever in memory.
Choosing a DataReader or a DataSet:
When deciding whether your application should use a DataReader (see Retrieving Data Using the DataReader) or a DataSet (see Creating and Using DataSets), you should consider the type of functionality that your application requires. Use a DataSet to do the
Following:
Remote data between tiers or from an XML Web service. Interact with data dynamically such as binding to a Windows Forms control or combining and relating data from multiple sources. Cache data locally in your application. Provide a hierarchical XML view of relational data and use tools like an XSL Transformation or an XML Path Language (XPath) Query on your data. For more information, see XML and the DataSet. Perform extensive processing on data without requiring an open connection to the data source, which frees the connection to be used by other clients. If you do not require the functionality provided by the DataSet, you can improve the performance of your application by using the DataReader to return your data in a forward-only read-only fashion. Although the DataAdapter uses the DataReader to fill the contents of a DataSet (see Populating a DataSet from a DataAdapter), by using the DataReader you can receive performance gains because you will save memory that would be consumed by the DataSet, as well as saving the processing required to create and fill the contents of the DataSet.
61. What are the different types of joins in SqlServer?
62. Difference ASP and ASP.NET
63. Difference - Server.Execute, Server.Transfer, Response.Redirect
Response.Redirect
The Response.Redirect method causes the browser to connect to a specified URL. When the Response.Redirect() method is called, it creates a response whose header contains a 302 (Object Moved)
status code and the target URL. When the browser receives this response from the server, it uses this header information to generate another HTTP request to the new URL. When using the Response.Redirect method, the redirection happens at the client side and involves two round trips to the server: one to request the original page, which is met by the 302 response, and then a second to request the redirected page. Server.Transfer
The Server.Transfer method transfers execution from the current ASPX file to another ASPX file on the same web Server. When your code calls the Server.Transfer method, the current ASPX page terminates execution and the flow of control is transferred to another ASPX page. The new ASPX page still uses the response stream created by the prior ASPX page. When you use this method to navigate between pages, the URL in the browser still shows the original page, because the redirection occurs on the server side and the browser remains unaware of the transfer.
By default, the Server.Transfer method does not pass the form data or the query string of the original page request to the transferred page. But you can preserve the form data and query string of the original page by setting the optional second argument of the method to True. When you use this technique, though, you need to aware of one thing: the destination page uses the same response stream that was created by the original page, and therefore the hidden _VIEWSTATE field of the original page ends up on the second page. This causes the ASP.NET machine authentication check (MAC) to assume that the ViewState of the new page has been tampered with. Therefore, when you choose to preserve the form and query string collection of the originl page, you must set the EnableViewStateMac attribute of the Page directive to False for the destination page