Click here to Skip to main content
15,897,704 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Questionhow to print Pin
sathyan_82941-Apr-09 19:36
sathyan_82941-Apr-09 19:36 
AnswerRe: how to print Pin
Anubhava Dimri2-Apr-09 1:00
Anubhava Dimri2-Apr-09 1:00 
QuestionCalling a dll from vb.net Pin
Harks91-Apr-09 19:33
Harks91-Apr-09 19:33 
AnswerRe: Calling a dll from vb.net Pin
Jon_Boy2-Apr-09 1:31
Jon_Boy2-Apr-09 1:31 
GeneralRe: Calling a dll from vb.net Pin
Harks92-Apr-09 11:50
Harks92-Apr-09 11:50 
GeneralRe: Calling a dll from vb.net Pin
Jon_Boy3-Apr-09 2:09
Jon_Boy3-Apr-09 2:09 
QuestionWindows Message API problem for LVM_GETITEMTEXT Pin
Joshi, Rushikesh1-Apr-09 19:26
professionalJoshi, Rushikesh1-Apr-09 19:26 
QuestionCompare Two ListBoxes [modified] Pin
kjalandoon1-Apr-09 18:05
kjalandoon1-Apr-09 18:05 
Good day!

I have this windows application where I have to compare two listboxes(data came from a .csv file) and output the "incorrect lines" into another listbox.

Listbox1 is the "original source", Listbox2 contains "tampered data".
Example:
Listbox1:
---------
| A | 1 |
---------
| B | 2 |
---------
| C | 3 |
---------
| D | 4 |
---------
| E | 5 |
---------

Listbox2 :
---------
| A | 1 |
---------
| C | 2 |
---------
| B | 3 |
---------
| D | 4 |
---------
| E | 5 |
---------

Listbox3 should only have an output of lines that are correct:
---------
| A | 1 |
---------
| D | 4 |
---------
| E | 5 |
---------

How can I compare data between Listbox1 and Listbox2 before appending the result to Listbox3?
Could any of you please provide some inputs?


Thanks in advance! Smile | :)

---$$$---

Just an update, here is my code for those who want to help me.
Private Sub btnOpenCSV_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOpenCSV.Click
        ofdOpenCSV.Filter = "All CSV Files|*.csv;"
        If ofdOpenCSV.ShowDialog() = Windows.Forms.DialogResult.OK Then
            Dim strPathString As String
            Dim strTestString As String = ""
            Dim strArrString As String()
            Dim strCSVRollNumber, strCSVRFIDNumber As String

            strPathString = ofdOpenCSV.FileName.ToString

            Dim myStream As System.IO.StreamReader
            myStream = File.OpenText(strPathString)
            Try
                While myStream.Peek() <> -1
                    strTestString = myStream.ReadLine()
                    strArrString = strTestString.Split(",")
                    lstCSVListBox.Items.Add(strArrString(0).ToString & " :: " & strArrString(1).ToString)
                                        
                End While
            Catch ex As Exception

            End Try
            btnOpenCSV.Enabled = False
            lblCSVSuccesful.Text = "File has been loaded."
            
        End If
    End Sub
    
    Private Sub btnOpenAPI_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOpenAPI.Click
        ofdOpenAPI.Filter = "All CSV Files|*.csv;"
        If ofdOpenAPI.ShowDialog() = Windows.Forms.DialogResult.OK Then
            Dim strPathString As String
            Dim strArrString As String()
            Dim strTestString As String = ""
            Dim strAPIRollNumber, strAPIRFIDNumber As String

            strPathString = ofdOpenAPI.FileName.ToString
            
            Dim myStream As System.IO.StreamReader
            myStream = File.OpenText(strPathString)
            Try
                While myStream.Peek() <> -1
                    strTestString = myStream.ReadLine()
                    strArrString = strTestString.Split(",")
                    strAPIRollNumber = strArrString(1).ToString
                    strAPIRFIDNumber = strArrString(2).ToString
                    lstAPIListBox.Items.Add(strArrString(0).ToString & " :: " & strArrString(1).ToString)
                End While
            Catch ex As Exception

            End Try
            btnOpenAPI.Enabled = False
            lblAPISuccesful.Text = "File has been loaded."

        End If
    End Sub
    
    Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart.Click
        
        'WHAT SHOULD I PUT HERE?
        
    End Sub


modified on Thursday, April 2, 2009 11:38 PM

AnswerRe: Compare Two ListBoxes Pin
DaveAuld1-Apr-09 21:24
professionalDaveAuld1-Apr-09 21:24 
GeneralRe: Compare Two ListBoxes Pin
kjalandoon1-Apr-09 21:42
kjalandoon1-Apr-09 21:42 
Questionvb.net dataset object being exported and formatted in excel Pin
jazzgirl1-Apr-09 17:13
jazzgirl1-Apr-09 17:13 
Questionserious problem need serious help Ö Pin
udikantz1-Apr-09 16:42
udikantz1-Apr-09 16:42 
AnswerRe: serious problem need serious help Ö Pin
Luc Pattyn2-Apr-09 5:08
sitebuilderLuc Pattyn2-Apr-09 5:08 
GeneralRe: serious problem need serious help Ö Pin
Mehdi_S3-Sep-09 4:03
Mehdi_S3-Sep-09 4:03 
GeneralRe: serious problem need serious help Ö Pin
Luc Pattyn3-Sep-09 5:13
sitebuilderLuc Pattyn3-Sep-09 5:13 
QuestionsGrid2: Stop Resizing the Header when Column Width is out of range of Max width or Min Width Pin
VBAdvisor1-Apr-09 15:42
VBAdvisor1-Apr-09 15:42 
AnswerRe: sGrid2: Stop Resizing the Header when Column Width is out of range of Max width or Min Width Pin
VBAdvisor1-Apr-09 20:49
VBAdvisor1-Apr-09 20:49 
GeneralRe: sGrid2: Stop Resizing the Header when Column Width is out of range of Max width or Min Width Pin
VBAdvisor4-Apr-09 13:46
VBAdvisor4-Apr-09 13:46 
QuestionHow to read the public class name into a string Pin
C#Coudou1-Apr-09 14:23
C#Coudou1-Apr-09 14:23 
AnswerRe: How to read the public class name into a string Pin
Tom Deketelaere1-Apr-09 21:07
professionalTom Deketelaere1-Apr-09 21:07 
Questionunrardll referencing problem Pin
vaughan5121-Apr-09 11:07
vaughan5121-Apr-09 11:07 
AnswerRe: unrardll referencing problem Pin
Dave Kreskowiak2-Apr-09 5:39
mveDave Kreskowiak2-Apr-09 5:39 
GeneralRe: unrardll referencing problem Pin
vaughan5122-Apr-09 22:29
vaughan5122-Apr-09 22:29 
QuestionEnsureVisible in TreeView: how to ensure that horiz. scrollbar is aligned left Pin
mp00011-Apr-09 10:45
mp00011-Apr-09 10:45 
AnswerRe: EnsureVisible in TreeView: how to ensure that horiz. scrollbar is aligned left [modified] Pin
Henry Minute1-Apr-09 12:41
Henry Minute1-Apr-09 12:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.