DataRow - OverflowException:值对于 Int32 来说太大或太小

DataRow - OverflowException: Value was either too large or too small for an Int32

问题

我遇到了一些抛出以下错误的现有代码,这是使用 .net Framework 4.5.2 和 v4.0。30319\System。Data.dll

我已将代码示例简化为引发错误的部分。

查看了反编译的 dll,它似乎是一个错误,并且也在寻找修复此错误的新版本,但似乎这是 System.Data.[=12= 的最新版本]

数据库数据类型是 bigint

我将如何以尊重传入的 int64 值的方式更新行数据,而不是让它尝试转换为 int32?

错误

    Exception whilst flushing buffered appenders: System.ArgumentException:Value 
    was either too large or too small for an Int32.Couldn't store 
    <32370073298665472> in SerialisationTimeMilliseconds Column.  Expected type 
    is 
    Int32. ---> System.OverflowException: Value was either too large or too 
    small 
    for an Int32.
       at System.Convert.ToInt32(Int64 value)
       at System.Int64.System.IConvertible.ToInt32(IFormatProvider provider)
       at System.Data.Common.Int32Storage.Set(Int32 record, Object value)
       at System.Data.DataColumn.set_Item(Int32 record, Object value)
       --- End of inner exception stack trace ---
       at System.Data.DataColumn.set_Item(Int32 record, Object value)
       at System.Data.DataRow.set_Item(DataColumn column, Object value)

代码

    private static void PopulateRow(long number, DataRow row)
    {
         row[0] = number;
    }

代码中的列定义被混淆了,我假设它选择了传入值的数据类型。

更改而来
    Columns.Add("number", typeof(int));

    Columns.Add("number", typeof(long));