Skip to main content


Showing posts from February, 2011

iPhone FBConnect: Facebook Connect Tutorial

Now a days social networking websites like facebook are becoming very popular, so integrating facebook with app has become a necessity to make you application popular. We are going to do the same through this tutorial. The Facebook Connect SDK provides code which third-party developers can embed into their applications to connect to their Facebook accounts and exchange information with iPhone apps. It’s a way of embedding “social context” to an iPhone app, according to Facebook.
Create a Viewbased Application with name ‘FacebookAPI’.
1.Download Facebook Connect for iPhone SDK (
Just go through the project. In particular, the “Connect” sample project. Sample Project gives demo of some of the functionality.
1.1.Open src/FBConnect.xcodeproj from SDK that you downloaded, and your own project as well.
1.2.Drag n drop FBConnect group. Make sure “Copy items into destination group folder” is NOT …

.NET Interview FAQs - 1

What are the different terms that are related to the life cycle of a Remoting object?The related terms to the life cycle of a Remoting object are define as Lease Time, Sponsorship Time, RenewOnCallTime, and LeaseManagePollTime.

Lease Time: The LeaseTime property protects the object from the garbage collector. Every object created has a default leasetime for which it will be activated. Once the leasetime expires, the object is eligible again for garbage collector and is eventually destroyed. Default value is 5 minutes.
Sponsorship Time: Even though the leasetime of an object has expired, there still may be clients who would still need the remoting object on the server. In such cases the leasemanager keeps a track of such clients and asks them if they need the object and are ready to sponsor the object to extend its existence. This is done through SponsorshipTime property.
RenewOnCallTime: The RenewOnCallTime property defines the duration for which a remoting object's leas…

Differences between Window Services and Window Applications

Window Services:

1) They have no GUI (Graphical User Interface)

2) Used mainly for background processing or monitoring tasks.

3) They are found in the Services section of the Control Panel.

4)Installed using special utilities like InstallUtil.

5)They have startup types like Automatic, Manual


1) SMTP Service: used for sending emails across network

2)MSSQLServer Service: used for starting/stopping the SQL Server engine.

We can also create our own services and install them using InstallUtil.

Window Applications

1) They are GUI based.

2) Used for creating windows which can be run from their exe's stored a folder/desktop to enable the users to perform these kinds of tasks:

a)Data Entry(Ex: Inventory/Payroll management), Data viewing(view employee details)

b)Viewing hardware/software information of a system.

c) Games/ Graphics.

d)Customized calculators, Notepads, Explorers

3)They are not found in the Services section of Control Panel.

4)No startup types like Automatic/Ma…

Is it possible for a control to define a handler for an event, that the control can't itself raise?

Yes, It's is possible for a control to define a handler for an event, that the control can't itself raise.

These incidents are called attached events.

For example, a button controls in a grid. The button class defines a click event, but the grid class doest not. However, you can still define a handler for buttons in the grid by attaching the Click events of the button control.

Differences between method overloading and method overriding

Method Overloading and Method Overriding are both the techniques used to implement FUNCTIONAL POLYMORPHISM
They enhance the methods functionality using their respective features.

1) It involves having another method with the same name in a class or its derived class.

2)can be implemented with or without inheritance.

3)It is implemented by:

a)changing the number of parameters in different methods with same name.

b)changing the parameter data types (if the number of parameters are same)

c)changing parameter order.

4)applicable to static as well as non static methods:

5)no keywords needed before the method names in C#.

6)also called as COMPILE TIME Polymorphism.
example: int add(int a, int b)
return a+b;
int add(int a)
return a*5;


1) It involves having another method with the same name in a base class and derived class.

2)always needs inheritance.

3)It is implemented by having two methods with same name, same signature, but different implementation…

What is the use of yield keyword in C#?

Yield keyword is used in an iterator block to calculate the value for the enumerator object.

An iterator is a method,
get accessor, or operator that allows us to use foreach loop on object references of user-defined classes.

yield keyword can be used as:

1)yield return ;
2)yield break;

code snippet

using System;

//This namespace provides the IEnumerator interface

using System.Collections;

public class demo


//GetEnumerator method of IEnumerable interface creates the iterator

public IEnumerator GetEnumerator()


for (int i = 1; i <=5; i++)


yield return i;



static void Main()


demo t=new demo();

//foreach loop calls the GetEnumerator method

foreach (int i in t)







Found interesting?

Routed Events in WPF

Events are not a new part to know about if you are working in Microsoft Technologies, but now when WPF has introduce a new concept called as Rounted Events, we will look into the same.

DownloadDownload source code for Routed Events in WPF

The main thing we should take care in Routed Events is about control's hierarchy.  In WPF, a typical example of control's hierarchy is root level Window object, than Grid object and then the other controls which are resides on Grid Control.

The concept of Routed Events comes into the picture when we want to handle an event, that is originated from some other control in the hierarchy.  Say for example if any user clicks the Button control, that event which is normally a Button_click event, can be raised by The Button, The Label, The Gird or The Window.
Types of Routed Events :
Direct EventsBubbling EventsTunneling Events
1.  Direct Events :
Direct Events are very well known to .NET people who has worked on standard .NET contr…