المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : How to cast to a type stored in a field



C# Programming
06-10-2009, 02:24 AM
How do I use a field storing Type information?

private Type _DataType;
private Dictionary _BlobData;

...
_DataType cow = (_DataType)_BlobData[0];
//the previous line shows compiler error
//._DataType' is a 'field' but is used like a 'type'

Is "Type" not the right type?