이 메서드를 통해 항목을 추가하면이 클래스를 반복하는 방법은 무엇입니까? 그냥 누군가가 datatables에서 올바른 방향으로 날 지점 수 있다면 그렇게하는 데 사용되는 메신저 wonding 된 제네릭 목록에 아주 새로운 오전 다음 :이 호출 코드 호출 컬렉션어떻게 아이템을 추가하면이 클래스를 반복합니까?
에 사용합니까 무엇
For Each thisentry In dt.rows
Next
메인 클래스의 내 delciarations에
Dim infoNoProductAvail As List(Of infoProductsNotFound) = New List(Of infoProductsNotFound)()
이 내가 파일을 추가하고 있지만이 루틴에서 확인하고 목록의 카운트가이 개 제품에 얼마나입니다
, If medProductInfo.SKU.SKUID = 0 Then
infoNoProductAvail.Add(New infoProductsNotFound(thisenty2.Item("EAN13").ToString(), True))
End If
이이 클래스는
Public Class infoProductsNotFound
Public Sub New(tbcode As String, notfound As Boolean)
Me.tagbarcode = tbcode
Me.notfound = notfound
End Sub
Private tagbarcode As String = String.Empty
Private notfound As Boolean
Public Property tbcode() As String
Get
Return tagbarcode
End Get
Set(ByVal value As String)
tagbarcode = value
End Set
End Property
Public Property isNotFound() As Boolean
Get
Return notfound
End Get
Set(ByVal value As Boolean)
notfound = value
End Set
End Property
End Class
사용 해봤
을 시도 itselfs 다음 Function BuildExceptionsForEmail()
Dim retval As String = ""
Dim cnt As Int32 = 0
retval = "The following products are not avialable" & vbCrLf
For Each info As infoProductsNotFound In infoNoProductAvail
retval &= info.tbcode
cnt &= 1
Next
Return retval
하지만이 시점에서 어떤 이유로 내 정보 noproductAvail가 비어도에 불구하고 루틴이 2 위에 올 때 루틴은 무엇을 제공합니까? 몇 가지 옵션이 반복,
Dim infoNoProductAvail As New List(Of infoProductsNotFound)
다음 :
foreach는 thisentry :
또는 :
또는 반복자의 종류는 목록에있는 항목의 유형과 일치해야합니다 infoNoProductAvail ?? –