Monday, March 22, 2010

Abut: Abstract class

public abstract class AbstractClass
{
public abstract void AbstractMethod1();
public abstract void AbstractMethod2();

}


public class classA : AbstractClass
{

public override void AbstractMethod1()
{
//some functionality goes here
}

public override void AbstractMethod2()
{
//some functionality goes here

}
}




public class classB : AbstractClass
{

public override void AbstractMethod1()
{
//some functionality goes here
}

public override void AbstractMethod2()
{
//some functionality goes here

}
}


//How can we remove AbstractMethod2 from classB without
//removing AbstractMethod2 method from AbstractClass and without
//removing the classB : AbstractClass relationship

Tuesday, March 9, 2010

What is difference between ExecuteReader, ExecuteNonQuery and ExecuteScalar?

ExecuteReader : Use for accessing data. It provides a forward-only, read-only, connected recordset.
ExecuteNonQuery : Use for data manipulation, such as Insert, Update, Delete.
ExecuteScalar : Use for retriving 1 row 1 col. value., i.e. Single value. eg: for retriving aggregate function. It is faster than other ways of retriving a single value from DB.

Thursday, March 4, 2010

What is the Difference between Web.config and Machine.config?

Scope:
Web.config => For particular application in IIS.
Machine.config = > For All the applications in IIS
Created:
Web.config => Created when you create an application
Machine.config => Create when you install Visual Studio
Known as:
Web.config => is known as Application Level configuration file
Machine.config => is known as Machine level configuration file
Location:
Web.config => In your application Directory
Machine.config => …\Microsoft.NET\Framework\(Version)\ CONFIG


Posted by: Neeks |dotnetfunda

Wednesday, March 3, 2010

What is the difference between an EXE and a DLL?


1)You can create an object of Dll but not of the EXE.
2)Dll is an In-Process Component whereas EXE is an OUt-Process Component.
3)Exe is for single use whereas you can use Dll for multiple use.
4)Exe can be started as standalone where dll cannot be.


Posted by: Blessybaby @ http://www.dotnetfunda.com/interview/showcatquestion.aspx?start=24&page=3&category=32

Tuesday, March 2, 2010

How many types are there in GoF patterns?

An advanced interview question start like this.

There are Three types of Gof patterns as of now.

They are

1) Creational patterns
this type of patterns deals with how they are created.

2) Structural patterns
this type of patterns deals with how they are organized.

3) Behavioral patterns
this type of patterns deals with how they are communicated with each other.

Sunday, February 28, 2010

Describe Typed Dataset

This is an important question in the interview now a days.

Typed data sets are pre defined datasets against normal one in the way of defining datatables, datarows and their relationships in a form of xsd file.

Wednesday, February 24, 2010

Differences between subquery and correlated subquery

    A correlated subquery is a subquery where the inner query is evaluated once for every value returned by the outer query. Generally a query which has a subquery will execute the subquery once and substitute the resulting value or values into the WHERE clause of the outer query. In queries that include a correlated subquery (also known as a repeating subquery), the subquery depends on the outer query for its values.

   
For example, using the northwind database, if you want to find out the price of all the books ordered, you can use a correlated subquery. Price information about each book is in the [Order Details] table, and the Orders table has all the books ordered.



SELECT O.OrderID, O.OrderDate,
(SELECT MAX (Od.UnitPrice) FROM [Order Details] AS Od
WHERE Od.OrderID = O.orderid) AS MaxUnitPrice
FROM Orders AS O

   
The subquery runs once for each row that the main query returns. This repeated access to the [Order Details] table could be inefficient. Generally, correlated subqueries can be re-written as a query using a join

Wednesday, January 13, 2010

What is the difference between Session.Abandon() and Session.Clear()?

This is the famous interview question about sessions.

Session.Abandon() will end current session by firing Session_End and in the next request, Session_Start will be fire.

Session.Clear( ) just clears the session data without killing it. With session.clear variable is not removed from memory it just like giving value null to this session.

Session ID will remain same in both cases, as long as the browser is not closed