dOTnET QA

Q What is assembly? and what is difference between the .dll and .exe?
A: Assembly is basic unit of .net program & it contains all .net code, resources like class, interface, methods etc.
1)exe & dll are same but differ by:
exe is an executable code & machince dependent whereas dll is not any executable code basically it is called by different applications.
2) we can’t deploy exe in GAC like dll as no class or methods are exposed in exe .

*******************************************

Q. What is Unmanaged code ?
A
. Unmanaged code is simply all code pre .NET. It is all code NOT compiled to operate under .NET’s runtime, the CLR. Unmanaged code can be native C++ with pointers, or C, or VB 6, or Delphi, etc. It is everything not managed by the CLR. In the CLR, code is compiled into IL + metadata into assemblies and then those assemblies are JITed into assembly language instructions while called. It is the metadata throughout that allows managed code to be managed, managed by the CLR. The CLR can control the type definitions and boundaries, control memory through automatic management of data via the garbage collector, and provide CAS security among other benefits. So a class is managed code IF compiled with a .NET compiler and controlled by the CLR whereas “other code is unmanaged” because it is compiled without a .NET compiler and uses the unmanaged heap for memory and knows nothing of the CLR.

*************************************************

Q What is Execution Plan in SQL?

An execution plan is basically a road map that graphically or textually shows the data retrieval methods chosen by the SQL Server query optimizer for a stored procedure.
SQL Server basically place the execution plan for stored procedure in its cache.

**********************************************

Q Select * from table1,table2
A It uses the cross join because column names are taken from more than one table.that means there must be a comman column in the all the tables.

**********************************

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

Q What is the main difference between RegisterStartUpScript and RegisterClientScriptBlock?
A They both are used to execute javascript code from code behind file.
RegisterStartUpScript Add the javascript code at the end of the page before the closing of form tag. while RegisterClientScriptBlock place the code at th top of the page.

******************************

Q Can Class be declared as Protected?
A Actually yes, it can be done with nested classes.
public class OuterClass
{
protected class NestedClass
{
}
}

You cannot declare protected classes at the namespace level because it would be meaningless.

******************************

Q4 Diversities between an abstract method & virtual method ?
Abstract Method
Abstract method must be declared as public and it is mandatory that the abstract method must be overridden in the child class. If it is not overridden by child compiler generates error.
It is also known as pure virtual function.
Abstract method must be declared inside an Abstract class, but the vice verse is not correct.

Virtual Method
where as the virtual method has an implementation and leaves an option to override it in the deriving class.

***************************

Q5 Why ‘static’ keyword is used before Main()?
A5 Program execution starts from Main(). S it should be called before the creation of any object. By using static the Main() can now be called directly through the class name and there is no need to create the object to call it. So Main() is declared as static.

********************************

Properties
CLR offers two kinds of properties:
parameterless properties i.e. simple properties
parameterfull properties i.e. indexers

OOPs stress on Data Encapsulation means your type fields should never be publicly exposed and using properties:
1) you can define different scope for getter and setter.
2) you can place code within getter and setter

******************************************************

Const vs readonly

both protects from accidentally changing the value of the field i.e. both can’t be modified.
Const

Can’t be static

Value is initialized at compile time.

Can be Initiailized at declaration only.

Readonly

Can be either an instance member or static.

Value is initialized at run time.

Can be either initialized in declaration or in the constructor.
eg: public readonly DateTime dt = DateTime.Now

******************************************************

Application Pool
You can separate different Web applications and Web sites into groups known as application pools.
Any Web directory or virtual directory can be assigned to an application pool. like W3wp.exe
This ensures that if a worker process fails, it does not affect the applications running in other application pools.
Any Web directory or virtual directory can be assigned to an application pool.

***********************

Role of IIS
When request comes from client it first hits the IIS Server, then the server passed it to ASP.NET worker process to execute. Then the response also passes to client via IIS itself.
IIS can support following Protocol HTTP/HTTPS, FTP, FTPS, SMTP Etc.
It can takes control of logging, application mapping thru URL.
Visual studio 2005 have its own ASP.NET Engine which is capable enough to run Asp.net web application from visual studio.

**************************

–>Can multiple catch blocks be executed for a single try statement?
No.  Once the proper catch block processed, control is transferred to the finally block (if there are any).

*************************

–>Why can’t you specify the accessibility modifier for methods inside the interface?
They all must be public, and are therefore public by default.

*************************

–>Can you declare an override method to be static if the original method is not static?
No.  The signature of the virtual method must remain the same.  (Note: Only the keyword virtual is changed to keyword override)

–>If a base class has a number of overloaded constructors, and an inheriting class has a number of overloaded constructors; can you enforce a call from an inherited constructor to a specific base constructor?
Yes, just place a colon, and then keyword base (parameter list to invoke the appropriate constructor) in the overloaded constructor definition inside the inherited class.

*************************

–>ASP.NET 2008 Features

(1)By the LINQ Support we can Compile time checking C# language queries, and the ability to debug step by step through queries
(2)In Visual Studio 2008 we can get extensive web designer and JavaScript tool.

(3)VS 2008 provides game development library kits for games developers
(4)We can easily develop the 2D and 3D graphic applications

(5)No need to install AJAX control library separately there is a built-in AJAX control library in this library we can use Menu, TreeView, webparts .
(6)Visual Studio 2008 makes it is simpler with javascript debugging and also use break point in javascript

(7)Nested Master page on eof good feature included in VS2008
(8)Visual Studio 2008 contains intellisense support for javascript

(9)When we use HTML or ASP markup text in source window automatically corresponding item will be selected in design window
(10)Silverlight in VS 2008 is inbuilt

(11)C++ SDK Libraries and tools which helps in developing windows based applications are now inbuilt with VS 2008 and easily configurable
(12)Visual Studio is now in English, Spanish, French, German, Italian, Chinese Simplified, Chinese Traditional, Japanese, and Korean. Over the next couple of months. Microsoft is reengineering the MUI which supports nine local languages then you can even view Visual studio in other 9

(13)Popfly explorer is an add-on to VS 2008

Here are some most important features of VS 2008
(1)Expression blend support is available in Visual 2008. Its a XAML generator tool for silverlight application.We can install expression blend as an embedded plug-in in Visual Studio 2008.

(2)WPF (Windows Presentation Foundation) provides more graphic functionality in Visual studio we can create 2D and 3D graphic application in it.
(3)In Visual Studio 2008 we can build game there is a library kits

for games developers. currently this game development kits are available for C++ and also 2D/3D Dark Matter one image and sounds sets.

(4)One of most useful feature of .net3.5 is we can able to create,run,debug .NET 2.0, .NET 3.0, .NET 3.5 application. We can also deploy .NET 2.0 application in machine where .NET 2.0 is not installed.
(5)In previous version we have to make a seprate setup of AJAx Control library but in Visual 2008 there is a built-in AJAX Contrl library.

(6)One of most good feature is that now we can debug Javascript we can set a break point in javascript.
(7)In VS 2008 you can even edit the nested master pages.

(8)Visual Studio 2008 contains intellisense support for javascript.
(9)VS 205 has a feature show both design and source code in single window. but both the windows tiles horizontally.

(10)In VS 2008 we can create, debug and deploy the silverlight applications.
(11)In VS 2008 there is Inbuilt C++ SDK
Q How many types of cookies are available in asp?

A: Persistent cookies are stored on your computer hard disk.  They stay on your hard disk and can be accessed by web servers until they are deleted or have expired.  Persistent cookies are not affected by your browser setting that deletes temporary files when you close your browser.

Non-persistent cookies are saved only while your web browser is running.  They can be used by a web server only until you close your browser.  They are not saved on your disk.  Microsoft Internet Explorer 5.5 can be configured to accept non-persistent cookies but reject persistent cookies.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s