摘要:
最近发现以前写的下面两个方法都有错误,default(string) 是null ,null is string 返回falsestatic class Extend { const string def = "dd"; public static T GetValue<T>(this DataRow dr, string name) { try { if (dr[name] == DBNull.Value) { object o = def; return (T)o; } else { return (T)dr[name]; } } catch (Argume 阅读全文