Here is your request:
UPDATE Settings SET seconds = '123');
- remove the last bracket - it is not needed
- What type of field is
seconds ? if int , then you will have to do the following: convert the string value numericUpDown1.Value to int - determine which field will be updated - add
WHERE - do not use string concatenation in SQL NEVER!
here:
MySqlCommand cmd = new MySqlCommand("UPDATE Settings SET seconds = " + Convert.ToInt32(numericUpDown1.Value) + ";", cnt);
but the following code would look even better:
SqlCommand cmd = new SqlCommand("UPDATE Settings SET seconds = @Sec WHERE id = 42", cnt);//допустим id = 42 SqlParameter param = new SqlParameter(); //задаем имя параметра param.ParameterName = " @Sec "; //задаем значение параметра param.Value = numericUpDown1.Value; //param.Value = Convert.ToInt32(numericUpDown1.Value); если sеconds int //param.SqlDbType = SqlDbType.Int; //задаем тип параметра param.SqlDbType = SqlDbType.NVarChar; //передаем параметр объекту класса SqlCommand cmd.Parameters.Add(param); cmd.ExecuteNonQuery();