parse枚举前需要注意的一点

 if (!Enum.IsDefined(typeof(SearchMode), options))
     throw new ArgumentException(Properties.Resources.InvalidEnumerationValue, "options");

如果数据库中存储的值,在程序里用枚举表示,在做parse的时候可以使用这样的方法监测options的值。

posted @ 2009-01-05 14:53  new 维生素C.net()  阅读(232)  评论(2编辑  收藏  举报