I want to be able to get an instance of a class based on two fields in that class. I was hoping to use something like a dictionary, because I thought indexing would be the best for performance. Should I just use LINQ or go back to a strongly typed dataset? Here's an example of what I'm trying to do:
Code:Dim n As New Name("wild", "bill") Dim dict As New Dictionary(Of String(), Name) dict.Add(New String() {"wild", "bill"}, n) Dim key() = New String() {"wild", "bill"} Debug.WriteLine(dict.ContainsKey(key)) 'false ... Public Class Name Public FirstName As String Public LastName As String Public NameCount As Integer Public Sub New(ByVal first As String, ByVal last As String) Me.FirstName = first Me.LastName = last End Sub End Class




Reply With Quote