c# OleDb插入到溢出异常

时间:2022-09-21 15:38:23

My query looks like this:

我的查询是这样的:

INSERT INTO tblFiles (filename,downloadname,description,length,parts,checksum) 
VALUES ('IMG_0228.JPG','file1','description1'
        ,2694310,1925,26931139928208758813621215525179134210220)

I am using an access database and my table looks like this:

我正在使用一个access数据库,我的表是这样的:

c# OleDb插入到溢出异常

This is the exception I get:

这是我得到的例外:

An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in System.Data.dll Additional information: Overflow

类型'System.Data.OleDb的未处理异常。发生在System.Data OleDbException”。dll:附加信息溢出

I do not understand what is causing this.

我不明白是什么引起的。

1 个解决方案

#1


2  

The problem is with column datatype.

问题是列数据类型。

You tried to insert 26931139928208758813621215525179134210220 into number column which obviously generate overflow error.

您试图插入26931139928208758813621215525179134210220到number列,这显然会产生溢出错误。

You should change datatype of checksum column to string/binary.

您应该将checksum列的数据类型更改为string/binary。

#1


2  

The problem is with column datatype.

问题是列数据类型。

You tried to insert 26931139928208758813621215525179134210220 into number column which obviously generate overflow error.

您试图插入26931139928208758813621215525179134210220到number列,这显然会产生溢出错误。

You should change datatype of checksum column to string/binary.

您应该将checksum列的数据类型更改为string/binary。