首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

System.InvalidOperationException: Conversion failed because the DateTime data va

2014-03-19 
导出数据 出现异常 :System.InvalidOperationException: Conversion failed because the DateTime data val

导出数据 出现异常 :System.InvalidOperationException: Conversion failed because the DateTime data value overflowed the type specified for the DateTime value part in the consumer s buffer.
at System.Data.OleDb.ColumnBinding.Value()
at System.Data.OleDb.OleDbDataReader.GetValues(Object[] values)
at System.Data.ProviderBase.DataReaderContainer.CommonLanguageSubsetDataReader.GetValues(Object[] values)
at System.Data.ProviderBase.SchemaMapping.LoadDataRow()
at System.Data.Common.DataAdapter.FillLoadDataRow(SchemaMapping mapping)
at System.Data.Common.DataAdapter.FillFromReader(DataSet dataset, DataTable datatable, String srcTable, DataReaderContainer dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue)
at System.Data.Common.DataAdapter.Fill(DataSet dataSet, String srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords)
at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable)
at MsaFluxC_2.Service_C.myTimer_Elapsed(Object sender, ElapsedEventArgs e)


------解决方法--------------------------------------------------------
日期格式不对或超范围
------解决方法--------------------------------------------------------
日期格式转换失败!~
------解决方法--------------------------------------------------------
同上,只能看出这些,代码贴上来看看
------解决方法--------------------------------------------------------
极可能:
你在数据库里,日期列的值为空,页你绑定的时候用了Convert.toDateTime()

加个条件判断吧
------解决方法--------------------------------------------------------