简体   繁体   English

对于 Int32.in C#,值要么太大要么太小

[英]Value was either too large or too small for an Int32.in C#

private void MINOR_VICTIM_INFO_Load(object sender, EventArgs e)
{
    DataTable DE = vc.GetMaxMinorNo();
    if (DE.Rows.Count > 0)
    {
        if (DE.Rows[0][0].ToString() == "")
        {
            txtuniqueminorno.Text = "12345678901";
        }
        else
        {
            int majoradded = Convert.ToInt32(DE.Rows[0][0].ToString()) + 1;
            txtuniqueminorno.Text = majoradded.ToString();
        }
    }
}

Integer Limits整数限制

At some point in your code you have an integer that is outside of these limits.在您的代码中的某个时刻,您有一个超出这些限制的整数。 Use break points and the debugger to find when you are using a value that is outside of these limits.使用断点和调试器查找何时使用超出这些限制的值。

I would guess that if the error is definitely in this section of code, that looking at我猜想,如果错误肯定在这部分代码中,那看

DE.Rows[0][0]

will be where the error lies.将是错误所在。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 对于文本框中的Int32,值太大或太小 - Value was either too large or too small for an Int32 in Textbox 如何解决“对于UInt32,值太大或太小”的C# - How to fix “Value was either too large or too small for a UInt32” C# 对于无符号字节 C#,该值太小或太大 - The value was either too small or too large for an unsigned byte C# Decimal 的值太大或太小。 C# - Value was either too large or too small for a Decimal. C# C#oracledbtype.int16抛出错误,因为值对于int16而言太大或太小,尽管值是1或2 - c# oracledbtype.int16 throws error as value either too large or too small for int16 though value is 1 or 2 异常:对于 asp.net 中的 Int32,值太大或太小? - Exception:Value was either too large or too small for an Int32 in asp.net? 对于UWP Weather App中的Int32,值太大或太小 - Value was either too large or too small for an Int32 in UWP Weather App 处理图像时,Int32的值太大或太小 - Value was either too large or too small for an Int32 when processing image Int32的价值太大或太小 - Facebook和dotnetopenauth - Value was either too large or too small for an Int32 - Facebook & dotnetopenauth 对于Int32,值太大或太小。 读取和解析文本文件 - Value was either too large or too small for an Int32. Reading and parsing textfile
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM