how to sum two argument with executescalar
string connstr = @"Server=.\SQLEXPRESS ;Initial Catalog=ABJDATABASE;Integrated Security=True; Max Pool Size=100";
string query = "SELECT SUM(txtWeight,txtPriceItem) AS txtWeight,txtPriceItem FROM personalData";
SqlConnection conn = new SqlConnection(connstr);
conn.Open();
SqlCommand myCommand = new SqlCommand(query, conn);
txtTotalWeight.Text = Convert.ToString(myCommand.ExecuteScalar());
txtTotalPrice.Text = Convert.ToString(myCommand.ExecuteScalar());
conn.Close();
show an error:
only one argument pass so how to pass the second argument.