首页 > 数据库技术 > 详细

System.DBNull.System.IConvertible.ToDateTime

时间:2019-12-12 19:22:34      阅读:92      评论:0      收藏:0      [点我收藏+]

处理中间键报DBNULL的错误

[ PATIENT_ID = 2889706, PATIENT_NUM = 29275, TIMES = 1 ] Object cannot be cast from DBNull to other types.
   at System.DBNull.System.IConvertible.ToDateTime(IFormatProvider provider)
   at System.Convert.ToDateTime(Object value)
   at SiHome.BLL.Components.InsuranceAnalyze.CalcBillDetailDeptCodeAndDoctor(DataRow drPatientInfo, DataRow dtInBillDetail)
   at SiHome.BLL.Components.InsuranceAnalyze.Analyze(DataRow drPatientInfo)
   at SiHome.BLL.Components.AnalyzeIn_Sub.AnalyzeInsurance(SyncPatientData patientData, Database hisData, Database sihomeData, IDbTransaction tran)
   at SiHome.BLL.Components.AnalyzeIn_Sub.SyncAnalyzePatientInfo(SyncPatientData patientData, Boolean isJob, Database hisData, Database sihomeData)
   at SiHome.BLL.Components.AnalyzeIn_Main.AnalyzePatientSingle(SyncPatientData patientData)

 

将执行时间修改为默认值,即可。

,CAST(ISNULL(EXECUTE_TIME,‘1900-01-01 00:00:01‘) as datetime )
AS EXECUTE_TIME

技术分享图片

 

 

System.DBNull.System.IConvertible.ToDateTime

原文:https://www.cnblogs.com/betobe/p/12031102.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!