Hello
I am trying to get the total of a query to show up inside a message box, an example of the coding is as shown below:
private void btnTotal_Click(object sender, EventArgs e)
{
conn.Open();
cmd.CommandText = "select sum(weight)FROM tbl_Fleet";
cmd.ExecuteNonQuery();
conn.Close();
MessageBox.Show(cmd.CommandText);
}
}
I am trying to get the total of a query to show up inside a message box, an example of the coding is as shown below:
private void btnTotal_Click(object sender, EventArgs e)
{
conn.Open();
cmd.CommandText = "select sum(weight)FROM tbl_Fleet";
cmd.ExecuteNonQuery();
conn.Close();
MessageBox.Show(cmd.CommandText);
}
}