本文介绍了指数超出范围。必须是非负数且小于集合的大小。参数名称:vb.net中的索引的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Hello All,
我在下面的代码中遇到上述错误。错误行也会突出显示:
Hello All,
I am getting the above error in the following piece of code. The row of error is also highlighted:
Dim Debittotal As Integer = 0
Dim Credittotal As Integer = 0
If grdDebit.RowCount > 1 Then
For index As Integer = 0 To grdDebit.RowCount - 1
***** Debittotal += Convert.ToDecimal(grdDebit.Rows(index).Cells(2).Value)
Next
End If
If grdCredit.RowCount > 1 Then
For index As Integer = 0 To grdCredit.RowCount - 1
Credittotal += Convert.ToDecimal(grdCredit.Rows(index).Cells(2).Value)
Next
End If
Dim NewfnBalance As Integer = Debittotal - Credittotal
提前致谢。
推荐答案
这篇关于指数超出范围。必须是非负数且小于集合的大小。参数名称:vb.net中的索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!