title: C# Xamarin how to sum a column in SQLite with SELECT
body: <p>I'm writing a small program with Xamarin in C#, and I need to sum the values greater than 0 of one column of my table... At the moment I achieved this with:</p>
  
  <pre><code>var ent = conn.Table&lt;Transaction&gt;().Where(t =&gt; t.price &gt; 0);
  entLabel.Text = (ent.Sum(t =&gt; t.price)).ToString();
  </code></pre>
  
  <p>But I'd like to obtain the same result with a SELECT script. I tried this:</p>
  
  <pre><code>var ent = conn.Query&lt;Transaction&gt;("SELECT SUM(price) FROM Transaction WHERE price &gt; 0");
  entLabel.Text = ent.ToString();
  </code></pre>
  
  <p>Sadly, the result isn't a number, but a string like "System.Collection.something.blahblah".</p>
  
  <p>Am I missing something? I searched the syntax (pasted below) in the docs and other sites and it seems the same as mine.</p>
  
  <pre><code>SELECT SUM(column_name)
  FROM table_name
  WHERE condition;
  </code></pre>