且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何解决System.IndexOutOfRangeException:retryattempts?这是什么意思?

更新时间:2022-06-04 08:48:31

您好,



System.IndexOutOfRangeException异常表示您正在访问具有无效索引的数组或容器。也就是索引指的是一个不存在的项目。在您的代码中,
Hi,

The System.IndexOutOfRangeException exception indicates that you are accessing an array or container with an invalid index. That is the index refers to an item that does not exist. in your code,
int retryattempts = Convert.ToInt32(dr["retryattempts"]);

检查该索引的dr是否存在,否则您将获得此异常。



另请参阅: http ://msdn.microsoft.com/en-us/library/system.indexoutofrangeexception%28v=vs.110%29.aspx [ ^ ]



问候,

Praneet Nadkar

Check that dr for that index exists, otherwise you wil get this exception.

Also please refer to this : http://msdn.microsoft.com/en-us/library/system.indexoutofrangeexception%28v=vs.110%29.aspx[^]

Regards,
Praneet Nadkar