public static string ToDateTime(this object thisValue, SqlDateType parameterValue) { if (thisValue == null || thisValue == DBNull.Value) { return(String.Empty); } return(thisValue.ToString()); }
/// <summary> /// 将时间字段转换为指定的文本格式 注:自己扩展的只适用于SqlServer /// </summary> /// <param name="thisValud">要转换的字段</param> /// <param name="parameterValue">转换格式</param> /// <returns></returns> public static string ToDateTime(object thisValud, SqlDateType parameterValue) { return(thisValud.ToDateTime(parameterValue)); }