[英]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();
}
}
}
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.