I need to match a value that may not always be named exactly as stored within the Datatable, typically names where the first and last name position may not always correctly placed. This could potentially be further complicated when we deal with Asian names where there are more syllabuses along with their Christan name. Would I still be able to retrieve the desired value via filter Datatable?
Some example would be as follows:
Name in Datatable - Jason Lim Kai Rong
Potential Names given to compare:
āLim Kai Rongā, āKai Rongā, āKai Rong Limā, āJason Limā, āLim Kai Rong, Jasonā
The list can go on but is there any solution to cover these uncertainties?
Hey I believe,If no exact match is found, you can use string manipulation functions like Contains, IndexOf, or regular expressions to check for partial matches.
Letās take like u have a array or list of string variable with all possible values u want to compare
Being a list variable you can add values any time to that collection
Now use a assign a gyro compare the dt - datatable column with that list variable and return only then
matchedRows = (From row In dataTable.AsEnumerable()
Where listOfValues.Contains(row("ColumnNameToCompare").ToString.Trim)
Select row).CopyToDataTable()
Due to the lengthy list of names in the database, itās practically impossible to maintain a list of array for each name. Are there potentially other directions I could look into?