took me forever but I found a few articles and put them together. This is the code:
var SQLSELECT2 = "SELECT SUM(Price) FROM ProductEntered WHERE TransID=@0";
var sub2 = db.QueryValue(SQLSELECT2, transaction_id);
if(String.IsNullOrEmpty(Convert.ToString(sub2)))
{
sub2 = 0.00;
}