Posted on: 6/9/2015 8:22:25 PM | Views : 716

So there are two tables "tableformula" and "columnformula" columnformula contains foreign key of tableformula , when I try to delete a row from tableformula it gives the error  "cannot update or delete......"
how can i solve this in c# , I know in mysql you just have to set foreign key = 0 and than 1 again. But I have no idea how to do this here , should I write this statement in c# code as well? or should I delete corresponding columnformula row as well?
Here's the code 
// MySqlDataReader reader; cmd.CommandText = "Select UserId from Users where Username = '" + user + "';"; string query = "Delete from db where Dbname = '" + tn.Text + "' and Username = '" + user + "' ;"; string query1 = "Delete from tableformula where tablename = '" + tn.Text + "' ...

Go to the complete details ...