Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String^ config = "datasource=localhost;port=3306;username=root;password=;database=projekt_c++";
- MySqlConnection^ connectBase = gcnew MySqlConnection(config);
- MySqlCommand^ sqlCommand = connectBase->CreateCommand();
- MySqlTransaction^ sqlTransaction;
- connectBase->Open();
- sqlTransaction = connectBase->BeginTransaction(IsolationLevel::ReadCommitted);
- sqlCommand->Connection = connectBase;
- sqlCommand->Transaction = sqlTransaction;
- try {
- MySqlCommand^ sqlCommand = gcnew MySqlCommand("DELETE FROM uzytkownik WHERE pesel ='"+textPesel->Text+"'");
- sqlCommand->ExecuteNonQuery();
- sqlTransaction->Commit();
- }
- catch (Exception^ ex) {
- MessageBox::Show(ex->Message);
- sqlTransaction->Rollback();
- }
- this->Hide();
- connectBase->Close();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement