Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27020

VS 2008 I need some help with something..thats giving me a headache trying to solve lol

$
0
0
Awhile back i asked for help with an array or something i really don't recall,,but was answered by .Paul who gave me this code which helped out great.

Code:

        For Each udtManual In ItemList
            item_list.Add(udtManual.StrModel & "|" & _
                          udtManual.StrDocument & "|" & _
                          udtManual.StrDocType & "|" & _
                          udtManual.StrDescription & "|" & _
                          udtManual.StrByteSize & "|" & _
                          udtManual.StrFileSize & "|" & _
                          udtManual.StrStatus & "|" & _
                          udtManual.StrCRC & "|" & _
                          udtManual.StrFileName & "|" & _
                          udtManual.StrManualType)
        Next

But now I've run into a slight snag..with trying to add an Import from a txt file feature.
the above code would store the existing data in an ArrayList or Listof(T)

My Import feature would add lines/columns from a text file and show them in a listview.
what i need now is a way to add only items that are not already in the ItemList.

I thought i could do something like this,but then realized that the data in the ItemList was being stored as one long string..on each line..so this won't work :-)

Code:

        For IMPTest As Integer = 0 To ListView1.Items.Count - 1
            Dim IMPItem As String = ListView1.Items(IMPTest).SubItems(8).Text

            If Not (item_list.Contains(IMPItem)) Then
                                         
                item_list.Add(ListView1.Items(IMPTest).Text & "|" & _
                          ListView1.Items(IMPTest).SubItems(1).Text & "|" & _
                          ListView1.Items(IMPTest).SubItems(2).Text & "|" & _
                          ListView1.Items(IMPTest).SubItems(3).Text & "|" & _
                          ListView1.Items(IMPTest).SubItems(4).Text & "|" & _
                          ListView1.Items(IMPTest).SubItems(5).Text & "|" & _
                          ListView1.Items(IMPTest).SubItems(6).Text & "|" & _
                          ListView1.Items(IMPTest).SubItems(7).Text & "|" & _
                          ListView1.Items(IMPTest).SubItems(8).Text & "|" & _
                          ListView1.Items(IMPTest).SubItems(9).Text)
            Else
                MsgBox("It's In There")
            End If
 
        Next

any idea's? anyone

Viewing all articles
Browse latest Browse all 27020

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>