Got DropBox yet?

Have you heard of DropBox yet? Don’t hesitate to check it out if you haven’t. You sync all of your computers via the Dropbox servers, their basic free service gives you 2Gigs of space and works cross-platform (Windows, Mac, Linux)
It works by behaving like a folder under version control that automatically syncs any time something new is added or modified. It takes care of merging and conflicts without ever bothering you (in case of conflicts, it just shows both files and renames one of them appropriately).

C# extension method similar to Sql’s IN operator

Consider the code snippet below

if(a == x || a == y || a == z)

We can re-write this expression as:

  • Using array’s contains

 if( new [] {x,y,z}.Contains(a))

  • Using a similar syntax for the SQL’s IN operator by using extension

public bool IsIn(this T obj, params T[] collection) {
   return collection.Contains(obj);
}
And invoke as
if(a.IsIn(b, c, d)) { … }

Read more at Stackoverflow

Find the Port a Connection is Using in Sql Server

SELECT c.session_id, c.local_tcp_port, s.login_name, s.host_name, s.program_name
FROM sys.dm_exec_connections AS c INNER JOIN
            sys.dm_exec_sessions AS s on c.session_id = s.session_id
WHERE c.local_tcp_port 1433

I found this very useful when monitoring external access to your Sql Server instance.

The original post was here at SqlServerCentral

Fifa World cup 2010 kicks off today in South Africa

Fifa World cup 2010 kicks off today in South Africa. Yes, it is the first time Africa is hosting the tournament.
Looking forward to an entertaining month ahead and may the best team win.
Talk of favourites in this year’s event, and names like Spain, Argentina, and England and of course the perennial favourites Brazil come up.

At our office, we did a mini Odds/Bets and I was lucky to bet on the following teams as favourites to win the tournament: Brazil, France, Paraguay, Nigeria and Australia.
At least I have Brazil on my pot 🙂

Wish you all the best and may the best team carry the cup!

Use Cookie-free Domains for Components

When the browser makes a request for a static image and sends cookies together with the request, the server doesn’t have any use for those cookies. So they only create network traffic for no good reason. You should make sure static components are requested with cookie-free requests. Create a subdomain and host all your static components there.
If your domain is www.example.org, you can host your static components on static.example.org. However, if you’ve already set cookies on the top-level domain example.org as opposed to www.example.org, then all the requests to static.example.org will include those cookies. In this case, you can buy a whole new domain, host your static components there, and keep this domain cookie-free. Yahoo! uses yimg.com, YouTube uses ytimg.com, Amazon uses images-amazon.com and so on.
Another benefit of hosting static components on a cookie-free domain is that some proxies might refuse to cache the components that are requested with cookies. On a related note, if you wonder if you should use example.org or http://www.example.org for your home page, consider the cookie impact. Omitting www leaves you no choice but to write cookies to *.example.org, so for performance reasons it’s best to use the www subdomain and write the cookies to that subdomain.

Ref: Please read here

Asp.net – Invalid postback or callback argument. Event validation is enabled using ‘’

Asp.net – Invalid postback or callback argument. Event validation is enabled using ‘’

This is a common Asp.Net error when updating List Box items on the client side.
I asked this question on stackoverflow.com (Click here).

Just reflecting on how many views people have had on this question, it seems to be a common issue most Asp.Net developers encounter.