It is necessary to make removal from a DB through dataGrid. I delete via the standard socket that comes with the dataGrid, only added a button to update the data in the database. But for some reason, deletion only works if you run the exe file. In addition, if you run the project again, the string that I deleted is returned. I can not understand why.

this.призначенняTableAdapter.Update(this.apteka1DataSet.Призначення); 

Button code.

  • one
    Show the code, please. - Alexey Sarovsky
  • So, I understood what the problem was. I have 2 DB: one in the project folder, the second in the folder with the exe file. If run through exe, then in the database, which is in the folder with exe, it changes. If you run the project, the project works with the database, which is in the folder with the project. As a result, when opening a project, my lines from one database block another. If you delete one of them, then either the project or exe will not run. - Andrei
  • It is good that everything was decided. I remembered that one teacher in the university introduced this practice: he carried a soft toy with him on pairs. If you have a question, it gives a toy and you must first ask it (and no joke, it’s ok to ask how a person is). If the problem is not solved - already a question for the teacher. - Alexey Sarovsky
  • Yes, no matter how decided. I do not understand what to do. 2 bd is not the case, and you can not remove them. - Andrei
  • Everything is possible, only you really should not have 2 DB. Why this happens - you need to understand, but first you need more information, which databases, how you connect them, which connection / access paths are used. - BlackWitcher

0