Many possibilities. Make sure you're passing right values to query.
Case 1
Str = "insert into Students values("
Str += txtNick.Text.Trim()
Str += ","
Str += """" & txtFirst.Text.Trim() & """"
Str += ","
Str += """" & txtLast.Text.Trim() & """"
Str += ","
Str += """" & txtAge.Text.Trim() & """"
Str += ","
Str += """" & txtGender.Text.Trim() & """"
Str += ","
Str += """" & txtAddress.Text.Trim() & """"
Str += ","
Str += txtContact.Text.Trim()
Str += ")"
If you miss any value, this query'd fail. Say you're passing blank values, you'll get below query which is bad one.
insert into Students values(,'','','','','')
Case 2
Str = "DELETE from Students where NickName="
Str += txtNick.Text.Trim
Same as above, if you pass blank value, you'll get below query which won't work.
DELETE from Students where NickName=
Case N
Samething goes for all other
UPDATE
queries. If you pass blankstring('') when your validation fails, that query won't work.