VB Code:
Private Sub LoadTerminalComboBox() Try Dim iRow As DataRow Dim tmpTerminal As String = "" strProcedure = "LoadTerminalComboBox" cmbTerminal.Items.Clear() For Each iRow In dtBatchHeader.Rows If iRow.Item("terminal") = Convert.ToString(tmpTerminal) Then Else cmbTerminal.Items.Add(iRow("terminal")) tmpTerminal = iRow("terminal") End If Next Catch ex As Exception ErrorHandler(strProgram, strModule, strProcedure, Msg) End Try End Sub
Where are you calling this from? And I am not sure that I follow the logic statement your using.
VB Code:
if iRow.items("Terminal") = Convert.ToString(tmpTerminal) then
Is that like??????
VB Code:
if not iRow.Items("Terminal").ToString = String.Empty
Plus you clear the box everytime you clear this function. Even if it can not be repopulated.




Reply With Quote