How to join two hash table with Linq ?
-
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 ?
-
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 ?
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.
-
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.
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))
NextI 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.