I have done a little bit of research on this and looked through a few articles both here on StackOverflow as well as some blog posts, but haven't found an exact answer. I also read that it is possible to do it using the 4.0 framework, but have yet to find any supporting evidence.
So my question, is it possible to perform SOUNDEX via a LINQ to SQL Query?
Since .net 4 this will work as well:
from p in mytable
where SqlFunctions.SoundCode(p.MyRow) == SqlFunctions.SoundCode("test")
select p
More info here: http://msdn.microsoft.com/en-us/library/system.data.objects.sqlclient.sqlfunctions.soundcode.aspx
You can also use the SqlFucntions.Difference method, which maps to the Soundex function:
SqlFunctions.Difference(string, string) returns int - the higher the return value, the more "similar" the strings are.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With