title: linq sum in vb.net
body: <p>I need to make a query that look like this is SQL:</p>
  
  <pre><code>SELECT  CodProiect, SUM(Valoare)
  FROM DET
  WHERE CodProiect = 'cod_pr'
  GROUP BY CodProiect;
  </code></pre>
  
  <p>How can I write the same thing in LINQ?</p>
  
  <p>I have attempted this:</p>
  
  <pre><code>dim gac1 = (From ac1 In t_detalii _
              Where ac1!CodProiect = cod_pr1 _
              Select ac1!Valoare).Sum(Function(ac1) ac1!Valoare)
  </code></pre>
  
  <p>But it gives me an error "No default member found for type 'Double'."</p>