Guest User

Untitled

a guest
Dec 3rd, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. user(int _number, string _name, string _sname, string _tname, bool _sex, int _age, int _birth_day, int _birth_mounth, int _birth_year, string _phone_number, string _adress, int _type_of_acces);
  2.  
  3. private: System::Void loginbutton_Click(System::Object^ sender, System::EventArgs^ e) {
  4. String^ constring = L"datasource=localhost;port=3306;username=root;password=root;database=bd";
  5. MySqlConnection^ conDataBase = gcnew MySqlConnection(constring);
  6. MySqlCommand^ cmdDataBase = gcnew MySqlCommand("select * from users where login='" + this->logintextbox->Text + "' and pass ='" + this->passtextbox->Text + "';", conDataBase);
  7. MySqlDataReader^ myReader;
  8. try {
  9. conDataBase->Open();
  10. myReader = cmdDataBase->ExecuteReader();
  11. int count = 0;
  12. while (myReader->Read()) {
  13. count++;
  14. }
  15. if (count == 1) {
  16. MessageBox::Show("Corect!");
  17. }
  18. else MessageBox::Show("Username and pass is not corect!");
  19. }
  20. catch (Exception^ex)
  21. {
  22. MessageBox::Show(ex->Message);
  23. }
  24. };
Add Comment
Please, Sign In to add comment