blog.mha.dk
The on-line blog of Michael Holm Andersen

Using LINQPad to query the database

Monday, 18 January 2010 18:17 by mha

If you’re working with LINQ, you simply can’t live without LINQPad. Below is a screenshot from the query:

from ans in UserAnswers
group ans by new {ans.AnswerId, ans.Answer.Content, 
                  Q=ans.Answer.Question.Content}
into myGroup
select new {myGroup.Key.Q, myGroup.Key.Content, Antal = myGroup.Count()}
 

- being able to do realtime queries against the database is simply awesome. And for only $29 you’ll have Autocompletion (which of course is a must-have / timesaver).

The query shows simple statistics about a poll, where question (Q), answer (Content) and total votes (Antal) is pulled out from the database – I’ve blurred the value of Count() in order to “protect” the clients data…

limfjordspoll_linq

Categories:   LINQ | Tools
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed
Comments are closed