我有一个具有2个固定列和动态行的2-d数组列表。 arraylist将被分配到下面的代码末尾的会话变量。我的问题是如何从会话中循环播放列表来获得它的价值?在会话中从二维数组列表中获取值
If .SQLDS.Tables(.sSQLDSTbl).Rows.Count > 0 Then
Dim NoOfAdjType(1, .SQLDS.Tables(.sSQLDSTbl).Rows.Count - 1)
For iRow As Integer = 0 To .SQLDS.Tables(.sSQLDSTbl).Rows.Count - 1
If Not .SQLDS.Tables(.sSQLDSTbl).Rows(iRow).Item("i_commAmt") Is System.DBNull.Value Then
NoOfAdjType(0, iRow) = .SQLDS.Tables(.sSQLDSTbl).Rows(iRow).Item("productType")
NoOfAdjType(1, iRow) = Format(.SQLDS.Tables(.sSQLDSTbl).Rows(iRow).Item("i_commAmt"), "#,##0.00")
End If
Next
Session("iNoOfAdjAmtType") = NoOfAdjType
End If
我都试过,但它给我的错误“太多的参数‘公共可覆盖默认属性项目(指数为整数)作为对象’
Dim NoOfAdjType As ArrayList = CType(Session("iNoOfAdjAmtType"), ArrayList)
For i As Integer = 0 To NoOfAdjType.Count
Dim a As String = NoOfAdjType(0, i)
Dim b As String = NoOfAdjType(1, i)
Next
感谢,但我怎样才能在行数数组列表? –
@Danferd,'NoOfAdjType.GetLength(0)'和'NoOfAdjType.GetLength(1)'。 –
谢谢@Darin ... –