Loads of things!
The first and biggest, is this: never concatenate strings to build a SQL command. It leaves you wide open to accidental or deliberate SQL Injection attack which can destroy your entire database. Use Parametrized queries instead.
The second is: we don't know - we don't have access to your data, so we can't tell.
But you do, and you have tools to help you work out what the problems is.
Start by putting a breakpoint on the line:
MessageBox.Show("Oops!! Something is wrong!!");
And change the line:
Command.ExecuteNonQuery();
To:
int count = Command.ExecuteNonQuery();
And put a breakpoint on this line as well:
Connection.Close();
Now run your app in the debugger, and see which breakpoint it reaches.
If it gets the to MessageBox, then look at
ex
and it's Message, InnerException and see exactly what they say.
If it gets to the Connection.Close, then look at what is in
count
. Is it 1? Or is it 0? The return value is the number of rows the command affected, so if it's one then it worked and you need to look elsewhere. If it's zero, then it probably means that your WHERE clause didn't match any rows - so start looking at the values you pass to SQL.
We can't do any of that for you, but it should be pretty simple for you to do, and see what you get.