johny basha
The following link may help you for this, it even includes an example that is more or less similar to what you aim to do:
http://msdn.microsoft.com/en-us/library/system.object.gettype.aspx
Hope that helps.
-Mamta