I tried to do so, but nothing happens (I did not find a solution in the internet on this issue.

MySqlCommand deletedStudentCommand = new MySqlCommand("UPDATE Students CHANGE COLUMN `" + selectedd + "` `" + textBox1.Text + "`", sqlConnection); 
  • ALTER TABLE . UPDATE changes the data, not the structure. - Akina
  • I also tried this MySqlCommand deletedStudentCommand = new MySqlCommand ("ALTER TABLE Students CHANGE " + selectedd + " " + textBox1.Text + " TEXT", sqlConnection); - Andrei Reyz
  • It is necessary to show not the assembly code of the request, but the result of the assembly. Those. query text after all substitutions and padding. For hell knows what rubbish you have there in the variables lying around ... - Akina
  • The fact is that I don’t get any errors, I concluded it in try and catch - Andrey Reyz
  • Collect the query text in a separate variable. And show the result. - Akina

1 answer 1

 MySqlCommand deletedStudentCommand = new MySqlCommand("ALTER TABLE Students CHANGE `" + selectedd + "` `" + textBox1.Text + "` TEXT", sqlConnection);