Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. How to join two hash table with Linq ?

How to join two hash table with Linq ?

Scheduled Pinned Locked Moved Visual Basic
csharpquestionlinqdata-structures
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Dharmesh S Patil
    wrote on last edited by
    #1

    I have two hash table 1) LogoCount key Value item1-> 123 item2-> 10 item3-> 45 2)LogoGroupCount key Value item1-> item2,item3,item1 item5-> item5,item1 item2-> item2 I want to join this two hashtabel using linq in vb.net and answer will be 1)Result: key value item1-> item1 item5-> item1 item2-> item2 because item1 has max count if that not exist in hashtable 1 than it will get default 0 so how can i do ?

    C 1 Reply Last reply
    0
    • D Dharmesh S Patil

      I have two hash table 1) LogoCount key Value item1-> 123 item2-> 10 item3-> 45 2)LogoGroupCount key Value item1-> item2,item3,item1 item5-> item5,item1 item2-> item2 I want to join this two hashtabel using linq in vb.net and answer will be 1)Result: key value item1-> item1 item5-> item1 item2-> item2 because item1 has max count if that not exist in hashtable 1 than it will get default 0 so how can i do ?

      C Offline
      C Offline
      CHill60
      wrote on last edited by
      #2

      Please don't cross-post the same question across this site - choose whether you want to keep this question here or use How Do I Join 2 Hash Table In Linq With Vb.Net ?[^] and then delete the other. Either way - I've asked what you have tried - it might help to clarify what you are trying to do.

      D 1 Reply Last reply
      0
      • C CHill60

        Please don't cross-post the same question across this site - choose whether you want to keep this question here or use How Do I Join 2 Hash Table In Linq With Vb.Net ?[^] and then delete the other. Either way - I've asked what you have tried - it might help to clarify what you are trying to do.

        D Offline
        D Offline
        Dharmesh S Patil
        wrote on last edited by
        #3

        For Each logo In htLogoGroupCount
        Dim Count(logo.Value.Count - 1) As Integer
        For i As Integer = 0 To logo.Value.Count - 1
        Dim sOptLogo() As String = logo.Value(i).Split(":")
        Count(i) = sOptLogo(1)
        Next
        Dim MaxCount As Integer = Array.IndexOf(Count, Count.Max())
        Dim sLogoValue As String = logo.Value(MaxCount).ToString
        Dim sOptLogoName() As String = sLogoValue.Split(":")
        alstOptimize.Add(sOptLogoName(0))
        Next

        I will assign value to count by adding ":" symbol in htLogoGroupCount in value from htLogoCount and then try above code but i will do it by Linq.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups