Advertisement
Guest User

Untitled

a guest
Jan 15th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1.  
  2.  
  3. String^ config = "datasource=localhost;port=3306;username=root;password=;database=projekt_c++";
  4. MySqlConnection^ connectBase = gcnew MySqlConnection(config);
  5. MySqlCommand^ sqlCommand = connectBase->CreateCommand();
  6. MySqlTransaction^ sqlTransaction;
  7.  
  8. connectBase->Open();
  9.  
  10. sqlTransaction = connectBase->BeginTransaction(IsolationLevel::ReadCommitted);
  11. sqlCommand->Connection = connectBase;
  12. sqlCommand->Transaction = sqlTransaction;
  13.  
  14. try {
  15. MySqlCommand^ sqlCommand = gcnew MySqlCommand("DELETE FROM uzytkownik WHERE pesel ='"+textPesel->Text+"'");
  16. sqlCommand->ExecuteNonQuery();
  17. sqlTransaction->Commit();
  18. }
  19. catch (Exception^ ex) {
  20. MessageBox::Show(ex->Message);
  21. sqlTransaction->Rollback();
  22. }
  23. this->Hide();
  24. connectBase->Close();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement