Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8988543
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:01:39+00:00 2026-06-15T22:01:39+00:00

I have a code in VB.NET that I need to find duplicate items in

  • 0

I have a code in VB.NET that I need to find duplicate items in a list of Invoice, with same number (amounts could be different), here is what I got to do but is not working, I don’t know if I should use LINQ maybe… the database is in txt file.

Public Class Invoice
  Public Property amount As Decimal
  Public Property number As String
  Public Property date As Date

  'extracting information from txt file

  Dim pesquisanotas As List(Of Invoice) = New NotaRepositorio().research()

‘part is not working, it is bringing invoices number with digits over 1 instead of repeated invoice numbers:

Dim DuplicateInvoice= From c In pesquisanotas
                                  Where (c.number.Count > 1)
                                  Select c

                    For Each item In DuplicateInvoice
                        MessageBox.Show(item.number)
                    Next
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T22:01:40+00:00Added an answer on June 15, 2026 at 10:01 pm

    If the duplicates are already in the list, then this is how you can detect them:

    Class DemoClass
      Public Property amount As Decimal
      Public Property number As String
      Public Property [date] As Date
    End Class
    
    Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
      Dim lstSource As New List(Of DemoClass)
      lstSource.Add(New DemoClass With {.amount = 121, .number = "121", .date = #1/1/2012#})
      lstSource.Add(New DemoClass With {.amount = 122, .number = "122", .date = #1/2/2012#})
      lstSource.Add(New DemoClass With {.amount = 123, .number = "123", .date = #1/3/2012#})
      lstSource.Add(New DemoClass With {.amount = 124, .number = "124", .date = #1/4/2012#})
      lstSource.Add(New DemoClass With {.amount = 125, .number = "125", .date = #1/5/2012#})
      lstSource.Add(New DemoClass With {.amount = 126, .number = "126", .date = #1/6/2012#})
      lstSource.Add(New DemoClass With {.amount = 127, .number = "127", .date = #1/7/2012#})
      lstSource.Add(New DemoClass With {.amount = 128, .number = "123", .date = #1/8/2012#}) 'dup'
      lstSource.Add(New DemoClass With {.amount = 129, .number = "129", .date = #1/9/2012#})
      lstSource.Add(New DemoClass With {.amount = 130, .number = "130", .date = #1/10/2012#})
      lstSource.Add(New DemoClass With {.amount = 131, .number = "122", .date = #1/11/2012#}) 'dup'
      lstSource.Add(New DemoClass With {.amount = 132, .number = "132", .date = #1/12/2012#})
    
      For intOuter As Integer = 0 To lstSource.Count - 2
        For intInner As Integer = intOuter + 1 To lstSource.Count - 1
          If lstSource(intOuter).number = lstSource(intInner).number Then
            'duplicate found
            MsgBox("Duplicate found: " & lstSource(intOuter).number)
          End If
        Next intInner
      Next intOuter
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a need to allow my users to execute .NET code that they
We have some legacy ASP.NET code that detects if a request is secure, and
I have code in the top layer of my .Net web application that I'd
If I have an IEnumerable object in my .net code that contains a single
I have ADO.Net code as below, that calls a stored procedure. Within the stored
Is there a tool that analyses .NET code and finds race conditions? I have
I have some code that uses ODP.Net using (OracleConnection connection = new OracleConnection(connectionString)) {
I have following code that I am compiling in a .NET 4.0 project namespace
I have a .net assembly that contains data access code (a bunch of Typed
I have a code base that has been used as an ASP.Net web application.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.