using System; public class Test { public static void Main() { Type t = typeof(int?); //will get this dynamically Type u = Nullable.GetUnderlyingType(t); object val = 5; //will get this dynamically object nVal = Convert.ChangeType(val, u);// nVal will be 5 Console.WriteLine("Type is: {0}, Value is: {1}", nVal.GetType(), nVal); } }