| |

VerySource

 Forgot password?
 Register
Search
View: 1286|Reply: 11

What is the cause of the following exception?

[Copy link]

1

Threads

6

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

Post time: 2020-2-20 21:00:01
| Show all posts |Read mode
Exported data: 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)
Reply

Use magic Report

0

Threads

9

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

Post time: 2020-4-29 02:00:01
| Show all posts
Incorrect date format or out of range
Reply

Use magic Report

0

Threads

23

Posts

20.00

Credits

Newbie

Rank: 1

Credits
20.00

 China

Post time: 2020-4-29 10:30:02
| Show all posts
Date format conversion failed! ~
Reply

Use magic Report

0

Threads

4

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-4-29 11:45:01
| Show all posts
As above, you can only see these, the code is posted to see
Reply

Use magic Report

0

Threads

31

Posts

17.00

Credits

Newbie

Rank: 1

Credits
17.00

 China

Post time: 2020-4-29 15:45:02
| Show all posts
Very likely:
You are in the database, the value of the date column is empty, and you use Convert.toDateTime () when you bind the page

Add a conditional judgment
Reply

Use magic Report

1

Threads

6

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

 Author| Post time: 2020-5-4 02:45:01
| Show all posts
Convert.toDateTime () is not used when querying Fill. Will it be related to the client's date and time zone configuration?
Reply

Use magic Report

1

Threads

6

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

 Author| Post time: 2020-5-5 14:15:01
| Show all posts
The tips in Chinese are as follows:
An exception occurred in the MsaFluxC export data: System.InvalidOperationException: The conversion failed because the DateTime data value overflowed the type specified for the DateTime value part in the user buffer.
   In 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) position E:\zxp\MyProgram\MsaFlux\Src\MsaFlux_2.0\MsaFluxC\Service_C.cs: line number 186
 Table_Log: select * from DTYW_CBSBGT where MRUT> = '2016-1-1 0:00:00' and MRUT <'2017-1-3 9:51:41' and GXBZ <> 'D'
Reply

Use magic Report

0

Threads

9

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

Post time: 2020-5-6 15:45:02
| Show all posts
Put select * from DTYW_CBSBGT where MRUT> = '2016-1-1 0:00:00' and MRUT <'2017-1-3 9:51:41' and GXBZ <> 'D'
Take a look in the query analyzer.
Reply

Use magic Report

0

Threads

32

Posts

22.00

Credits

Newbie

Rank: 1

Credits
22.00

 China

Post time: 2020-5-6 21:30:01
| Show all posts
.net datetime and database datetime, smalldatetime value range is different, it is different.
Check the specific value.
Reply

Use magic Report

1

Threads

6

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

 Author| Post time: 2020-5-11 14:30:01
| Show all posts
The specific value of datetime is the default 1900-01-01 of Sybase database

MsaFluxC export data has an exception: System.InvalidOperationException: The provider could not determine the DateTime value. For example, the row was just created, the default for the DateTime column was not available, and the consumer had not yet set a new DateTime value.
   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)
 Table_Log: select * from DTYW_CBSBYT where MRUT> = '2016-1-1 0:00:00' and MRUT <'2017-1-3 10:22:27' and GXBZ <> 'D'
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list