----------- Windows Phone 7手机开发、.Net培训、期待与您交流! ------------
1 public static object FormDbValue(object value) 2 { 3 if (value == DBNull.Value) 4 { 5 return null; 6 } 7 else 8 { 9 return value; 10 } 11 } 12 13 public static object ToDbValue(object value) 14 { 15 if (value == null) 16 { 17 return DBNull.Value; 18 } 19 else 20 { 21 return value; 22 } 23 } 24 }