variable
SQL
is a string. A
string
has no method
ExecuteScalar()
change
actamttxtbox.Text = SQL.ExecuteScalar();
to
actamttxtbox.Text = (string)command.ExecuteScalar();
And you don't need
cmd.ExecuteNonQuery();
I've cleaned up a little bit:
MySqlConnection conn = new MySqlConnection("connection-string");
conn.Open();
using(MySqlCommand cmd = new MySqlCommand()){
cmd.Connection = conn;
cmd.CommandText = "select sum(Actual_amt) from tds";
actamttxtbox.Text = cmd.ExecuteScalar().ToString();
}
conn.Close();