Need help with formulating LINQ query

Posted by eponymous23 on Stack Overflow See other posts from Stack Overflow or by eponymous23
Published on 2010-06-11T15:08:31Z Indexed on 2010/06/11 15:13 UTC
Read the original article Hit count: 192

Filed under:

I'm building a word anagram program that uses a database which contains one simple table:

Words
---------------------
varchar(15) alphagram
varchar(15) anagram
(other fields omitted for brevity)

An alphagram is the letters of a word arranged in alphabetical order. For example, the alphagram for OVERFLOW would be EFLOORVW. Every Alphagram in my database has one or more Anagrams. Here's a sample data dump of my table:

Alphagram   Anagram  
EINORST     NORITES
EINORST     OESTRIN
EINORST     ORIENTS
EINORST     STONIER
ADEINRT     ANTIRED
ADEINRT     DETRAIN
ADEINRT     TRAINED

I'm trying to build a LINQ query that would return a list of Alphagrams along with their associated Anagrams. Is this possible?

© Stack Overflow or respective owner

Related posts about LINQ