title: How to get SQL result saved into a C# variable?
body: <p>I have troubles finding out how to save an SQL result into a String or whatever type the result returns.</p>
  
  <p>My SQL query is:</p>
  
  <pre><code>SELECT SUM(Length) FROM tbl_test WHERE TITLE LIKE 't%'
  </code></pre>
  
  <p>Here I need a function that sums up the length of all data-rows where title begins with the letter "T", when executing the query in MS-SQL it returns "188.99" (the SQL type is decimal)</p>
  
  <p>My question is, how do I get to save that value into a C# variable? The query always returns ONE row with the particular value, which I want to save into a variable. I have a C# function to execute the query, I just need the value from that row, 188.99, to be saved into a variable. Any suggestions are cool, no matter if I the result is saved into a decimal variable or string.</p>