Better structured LINQ request

Discussion in 'Databases' started by kurtrichard, Aug 15, 2008.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Hi

    I'm kinda new at the whole SQL thing... and as soon as I got into that I found myself moving to using LINQ expression pretty quickly (this is probably why I don't have the knowledge to answer my own question!).

    I have a LINQ db request below:


     
  2. Try this:


     
  3. Many thanks indeed Jamie - that worked a treat and enable me to remove the extensive dataset fudge that I'd had to build in.

    It still feels a little like cheating so I will play a little more and post any progress I make... but for now the 'FirstOrDefault' trick works perfectly and is well worth knowing about.

    Thanks again, Kurt
     
  4. I love this kind of teamwork here. [​IMG]
     
  5. OK so I have done some fiddling and came up with an approach that satisfies my aethestic as well as technical tastes. Here is the revised query:

     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page