Delegates and Events in C# (1.1)

Delegates and Events in C# (1.1)

An excellent article

Debugging ASP.NET Applications with VS 2003

Debugging ASP.NET Applications with VS 2003

after hours of troubleshooting, I found this

If you created the Web project with a full machine name (like machinename.domainname.something), the Web site is recognized as Internet site. So, the default setting of Internet Explorer will impact on the behavior of logging on. In this case, you need to enable logging on with your current user account in “Internet” area with the IE setting.

Getting Caller method info

Getting Caller method name from method

StackTrace st = new StackTrace();
string str = st.GetFrame(1).GetMethod().Name;

Regular Expression

Regular Expression to select HTML elements from the text


.*? is for lazy (non-greedy) capture of the pattern.

SPS 2003 installation Issue

SPS 2003 installation: Installation ended prematurely because of an error

When re-installing SPS 2003 on a Windows 2003 Server, I got the error “Installation ended prematurely because of an error”.
To resolve this issue, I’ve to remove the Windows SharePoint Services 2.0 and then run the setup of SharePoint portal server 2003 again.  This will make the installation of SharePoint Portal Server 2003

Notes on C# 2.0 (Nullable Types)

C# 2.0 ( Nullable Types)

Nullable types are constructed using the ? type modifier. This token is placed immediately after the value type being defined as nullable. The type specified before the ? modifier in a nullable type is called the underlying type of the nullable type. Any value type can be an underlying type.

int? i;
Point? nullPoint = null;
i = null;
nullPoint = new Point?(point);
public struct Real
    int internalVal;
    public Real(int realNumber)
        internalVal = realNumber ;
Real? real = new Real?(new Real(3));
The null coalescing operator takes as arguments a nullable type to the left and the given nullable type’s underlying type on the right. If the instance is null, the value on the right is returned otherwise the nullable instance value is returned.
int? i;
i = 10;
int j = 20;
string str = Convert.ToString(i ?? j);
The statement (i ?? j) returns i if i is not null, otherwise it returns j.

The new ?? binary operator allows you to conditionally test for null and use an alternative value instead. For example, consider the following assignment.
int myvalue = (x != null ? x : 0);
With the ?? operator, this can be rewritten as:
int myvalue = x ?? 0;
This indicates to assign the value of x to the myvalue variable or 0 in the case that x is null.