获取错误IndexOutOfRangeException在vb.net中未处理

时间:2014-10-11 06:43:34

标签: vb.net

  ElseIf Comboroomdescrition.SelectedItem = "Exposed Glass" Then
        GroupBoxGlass.Show()
        GroupBoxRoomDetails.Visible = False
        GroupBoxWall.Visible = False
        GroupboxPartition.Visible = False
        ds = Database2DataSet4
        For i As Integer = 0 To ds.Tables("outside").Rows.Count - 1
            If combosseasoncode.SelectedValue = ds.Tables("equivalentglass").Rows(i).Item("scode") Then
                txtglassnorthetd.Text = ds.Tables("equivalentglass").Rows(i).Item("north")
                txtglasssouthetd.Text = ds.Tables("equivalentglass").Rows(i).Item("south")
                txtglasseastetd.Text = ds.Tables("equivalentglass").Rows(i).Item("east")
                txtglasswestetd.Text = ds.Tables("equivalentglass").Rows(i).Item("west")
                txtglassneetd.Text = ds.Tables("equivalentglass").Rows(i).Item("northeast")
                txtglassseetd.Text = ds.Tables("equivalentglass").Rows(i).Item("southeast")
                txtglassswetd.Text = ds.Tables("equivalentglass").Rows(i).Item("southwest")
                txtglassnwetd.Text = ds.Tables("equivalentglass").Rows(i).Item("northwest")
            Else
                Message("There is no ETD data available")
            End If
        Next
    ElseIf Comboroomdescrition.SelectedItem = "Exposed Wall and Roof" Then
        GroupBoxWall.Show()
        GroupBoxRoomDetails.Visible = False
        GroupBoxGlass.Visible = False
        GroupboxPartition.Visible = False
        ds = Database2DataSet4
        For i As Integer = 0 To ds.Tables("outside").Rows.Count - 1
            If combosseasoncode.SelectedValue = ds.Tables("equivalent").Rows(i).Item("scode") Then
                txtwallnorthetd.Text = ds.Tables("equivalent").Rows(i).Item("north")
                txtwallsouthsetd.Text = ds.Tables("equivalent").Rows(i).Item("south")
                txtwalleastetd.Text = ds.Tables("equivalent").Rows(i).Item("east")
                txtwallwestetd.Text = ds.Tables("equivalent").Rows(i).Item("west")
                txtwallneetd.Text = ds.Tables("equivalent").Rows(i).Item("northeast")
                txtwallseetd.Text = ds.Tables("equivalent").Rows(i).Item("southeast")
                txtwallswetd.Text = ds.Tables("equivalent").Rows(i).Item("southwest")
                txtwallnwetd.Text = ds.Tables("equivalent").Rows(i).Item("northwest")
                txtwallroofetd.Text = ds.Tables("equivalent").Rows(i).Item("roof")
            Else
                Message("There is no ETD data available")
            End If
        Next
End.

当运行上面的代码时,没有执行等效玻璃表,并且显示在0位置没有行,并且我们在等效表中使用相同的代码,它将被执行,在数据库中,表有数据' s

0 个答案:

没有答案