Sie sind auf Seite 1von 6

GENPACT

Machine.config:

1. This is automatically installed when you install. Net Framework. It is installed at
Microsoft.NET\Framework\v1.1.4322\CONFIG. It contains default and machine-specific values
for all supported setting.
2. Only one Machine.config file can exist on a server.
3. This file is at the highest level in the configuration hierarchy.
4. Its like a common repository for standard items and its over ridden by Web.config file.
5. Without the Machine.config file Application cannot be executed.
6. Machine.config is also an XML file like Web.config.
Web.config file
1. Web.config is used for ASP.NET Web Projects / Web Services. Web.config by default has several
configurations required for the web application. It is also called Application Level Configuration
File and inherits setting from the Machine.config file.
2. Web.config is parsed at runtime, so if you edit the Web.config file, the web application will
automatically load the changes in the config file.
3. Web.config file is automatically generated when new web application created.
4. You can have more than one Web.config file in your application. Specifically, you can have a
Web.config for each folder under your web application.
5. The Web.config file is required for ASP.NET webpages.
App.config file:
1. App.config is used for Windows Forms, Windows Services, Console Apps and WPF applications.
2. App.config is parsed at compile time, so if you edit the App.config file, you have to restart the
application. At compile time a copy of the App.config file is taken, renamed to [output].config
and moved to the build folder. This copy can then be modified, and your modifications will be
read each time the application/service is started.
3. App.config is not added automatically to an application. You can go to the solution explorer,
select 'Add new item' and add the 'Application Configuration File'.
4. There is always one App.config file in a window application.
5. The App.config file is optional in an application and doesn't have to be used when writing
desktop applications.

2. How to execute SP which is having Input and output parameters in SQL Server?
Ex:
create proc spMySample
@Id int,
@FName nvarchar(50),
@LName nvarchar(50),
@FullName nvarchar(50) output
As
Begin
select @FullName=@FName+@LName
end

declare @FullName nvarchar(50);
exec spMySample 1,'Krishna','Sai',@FullName output
Print @FullName

3. What is Difference between ExecuteScalar and ExecuteNonquery?

ExecuteNonQuery( ):

Will work with Action Queries only (Create,Alter,Drop,Insert,Update,Delete).
Returns the count of rows effected by the Query.
Return type is int
Return value is optional and can be assigned to an integer variable.

ExecuteScalar( ):

Will work with Non-Action Queries that contain aggregate functions.
Return the first row and first column value of the query result.
Return type is object.
Return value is compulsory and should be assigned to a variable of required type.

ExecuteReader( ):

Will work with Action and Non-Action Queries (Select)
Returns the collection of rows selected by the Query.
Return type is DataReader.
Return value is compulsory and should be assigned to an another object DataReader.

4. What is difference between Connected & DisConnected Archictecture?

Connected Archictecture:
The architecture of ADO.net, in which connection must be opened to access the data retrieved from
database is called as connected architecture. Connected architecture was built on the classes
connection, command, datareader and transaction.

Connected architecture is when you constantly make trips to the database for any CRUD (Create,
Read, Update and Delete) operation you wish to do. This creates more traffic to the database but is
normally much faster as you should be doing smaller transactions.



DisConnected Archictecture:
The architecture of ADO.net in which data retrieved from database can be accessed even when
connection to database was closed is called as disconnected architecture. Disconnected architecture
of ADO.net was built on classes connection, dataadapter, commandbuilder and dataset and
dataview.

Disconnected architecture is a method of retrieving a record set from the database and storing it
giving you the ability to do many CRUD (Create, Read, Update and Delete) operations on the data in
memory, then it can be re-synchronized with the database when reconnecting. A method of using
disconnected architecture is using a Dataset.



Connected Disconnected
It is connection oriented. It is disconnection oriented.
Datareader DataSet
Connected methods gives faster performance Disconnected get low in speed and performance.
connected can hold the data of single table disconnected can hold multiple tables of data
connected you need to use a read only
forward only data reader
disconnected you cannot
Data Reader can't persist the data Data Set can persist the data
It is Read only, we can't update the data. We can update data

5. Explain about Garbage Collector?
Memory management is the main concern for any application whether application is
window based or web based.
In .Net, CLR has garbage collector that executes as a part of our program and responsible for
reclaiming the memory of no longer used objects.
Garbage collector free the memory for objects that are no longer referenced and keeps the
memory for future allocations.
Advantage of Garbage Collector:
1. Allow us to develop an application without having worry to free memory.
2. Allocates memory for objects efficiently on the managed heap.
3. Reclaims the memory for no longer used objects and keeps the free memory for future
allocations.
4. Provides memory safety by making sure that an object cannot use the content of another
object.
Memory Allocation in Managed Heap:
The managed heap is a series of allocated memory segments (approx 16Mb in size each) to
store and manage objects.
The memory for newly created object is allocated at the next available location on the
managed heap. If there is available free memory, the garbage collector doesn't search the
dead objects for memory reclaim and memory allocations has been done very fast.
If the memory is insufficient to create the object, the garbage collector search the dead
objects for memory reclaim for the newly object.
An object is created using the new operator. This operator first makes sure that the bytes
required by the new object fit in the reserved region (committing storage if necessary). If
the object fits, NextObjPtr points to the object in the heap and object's constructor is called
and the new operator returns the address of the object.
Key points about Garbage Collector:
All objects in the heap are allocated from one contiguous range of memory address and
heap is divided into generations so that it is easy to eliminate the garbage objects by looking
at only a small fraction of the heap.
All objects in the heap are allocated from one contiguous range of memory address and
heap is divided into generations so that it is easy to eliminate the garbage objects by looking
at only a small fraction of the heap.
Almost, all objects with-in a generation are of the same age
The newest objects are created at higher memory address while oldest memory objects are
at lowest memory address with in the heap.
Periodically the heap is compacted by removing the dead objects and sliding up the live
objects towards the lower memory address end of the heap.

Generations in Managed Heap:
The managed heap is organized into three generations so that it can handle short lived and
long lived objects efficiently. Garbage collector first reclaim the short lived objects that occupy a
small part of the heap.

1. Generation 0
This is the youngest generation and contains the newly created objects. Generation 0 has short-lived
objects and collected frequently. The objects that survive the Generation 0 are promoted to Generation 1.
Example: A temporary object.
2. Generation 1
This generation contains the longer lived objects that are promoted from generation 0. The objects
that survive the Generation 1 are promoted to Generation 2. Basically this generation serves as a buffer
between short-lived objects and longest-lived objects.
3. Generation 2
This generation contains the longest lived objects that are promoted from generation 1 and collected
infrequently.
Example: An object at application level that contains static data which is available for the duration of
the process.

6. Explain about CLR?
7. Why we call Just-In-Time Compiler instead of Normal Compiler?
8. Difference between HTTP and HTTPS?
9. How HTTPS provides security and how we add Certificate?
10. Explain about CSS and how they called?

Das könnte Ihnen auch gefallen