Thursday, October 6, 2011

Generic Type Convert in C#

Cannot implicitly convert type 'object' to 'T'. An explicit conversion exists (are you missing a cast?) 

Following code can be use to convert your object to generic value.
T ret = (T)Convert.ChangeType(yourobject,typeof(T));
Post a Comment