I have got this code which SUM number(9,2)
values in SQL DB
, but the output is System.Data.SqlClient.SqlCommand
.
I know I have to Convert it somehow but have no idea how?
Would you please suggest me something? Thank you very much for your time.
conn.Open();
SqlCommand sc = new SqlCommand("SELECT SUM(price) AS sumprice FROM client WHERE subkey="+key,conn);
sc.ExecuteNonQuery();
conn.Close();
textBox20.Text = sc.ToString();
}