I would like to convert the following code to .NET from VB6

While Not rsMem.EOF
        i = i + 1

            lstView.ListItems.Add i, , rsMem.Fields("lname").Value
            With lstView.ListItems(i)
                .SubItems(1) = IIf(IsNull(rsMem.Fields("fname").Value), "-", rsMem.Fields("fname").Value)
                .SubItems(2) = IIf(IsNull(rsMem.Fields("Title").Value), "", rsMem.Fields("Title").Value)
                .SubItems(3) = IIf(IsNull(rsMem.Fields("telNo").Value), "", rsMem.Fields("telNo").Value)                
                .Tag = rsMem.Fields("per_id").Value
            End With
            rsMem.MoveNext
    Wend

lstView is a listview on the form.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.