cint方法 [英] cint method

查看:95
本文介绍了cint方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在页面中使用了代码
arrParam(1).Value = CInt(txtCustomerID.Value.Trim)

这将引发异常算术运算导致溢出" .........
代码中的问题是什么???如何处理???
txtCustomerID.Value.Trim该值无论如何都不会为null ....

In a page I have used a code
arrParam(1).Value = CInt(txtCustomerID.Value.Trim)

This is throwing an exception "Arithmetic operation resulted in an overflow".........
what is the problem in the code??? how to handle it???
txtCustomerID.Value.Trim this value will not be null anyway....

推荐答案

这意味着该数字太大.

可以使用 Convert.ToIntxx [ ^ ],数字的大小将在其中匹配您的输入.



您也可以先使用 IsNumeric [
It means the number is too big.

Instead of using CInt, you can use Convert.ToIntxx[^] where the size of the number will match your input.



You can also test the field first with IsNumeric[^].

Cheers.


您的txtCustomerID不是有效的整数

http://msdn.microsoft.com/en-us/library/5kzh1b5w% 28VS.80%29.asp [ ^ ]

txtCustomerID的值是什么?您想将什么值放入arrParam(1)

通过使用正确的数据类型捕获用户输入来解决问题.
Your txtCustomerID is not a valid integer

http://msdn.microsoft.com/en-us/library/5kzh1b5w%28VS.80%29.asp[^]

What is the value of txtCustomerID? What value are you trying to put into arrParam(1)

Problem is solved by using the correct data type to capture the user input.


这篇关于cint方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆