我的对话框上有这个代码:
Private Sub DAddSupplier_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim objProveedores As New AR.CMP.ControlCatalogo()
Dim dvClases, dvEstados As DataView
dvClases = objProveedores.ListarClasesProveedor()
If dvClases IsNot Nothing AndAlso dvClases.Count > 0 Then
For i As Integer = 0 To dvClases.Count
cmbClase.Items.Add(dvClases(i)("Class"))
Next
End If
'reach until here the debugger
dvEstados = objProveedores.ListarEstadosProveedor()
If dvEstados IsNot Nothing AndAlso dvEstados.Count > 0 Then
For j As Integer = 0 To dvEstados.Count
cmbEstado.Items.Add(dvEstados(j)("Name"))
Next
End If
End Sub
但只有到达第一个代码块,除非第一个被评论,否则它会被忽略,为什么会出现这种行为?