Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String^ duomenys = "Server=127.0.0.1;Uid=root;Pwd=;Database=sql7285942";
- MySqlConnection^ jungtis = gcnew MySqlConnection(duomenys);
- MySqlCommand^ funkcija = gcnew MySqlCommand("select * from vartotojai where user='" + this->textBox1->Text + "' and pass='" + this->textBox2->Text + "';", jungtis);
- MySqlDataReader^ skaitymas;
- try
- {
- int kiekis = 0;
- jungtis->Open();
- skaitymas = funkcija->ExecuteReader();
- while (skaitymas->Read())
- kiekis++;
- if (ArYraVartotojas(kiekis))
- {
- //this->Hide();
- Nuomininkai^ nuomininkaiForma = gcnew Nuomininkai();
- nuomininkaiForma->ShowDialog();
- }
- else
- MessageBox::Show("Vartotojas nerastas\nKreipkites į sistemos administratorių");
- }
- catch (Exception^ exceptionError)
- {
- MessageBox::Show(exceptionError->Message);
- }
- }
- bool ArYraVartotojas(int a)
- {
- if (a == 1)
- return true;
- else
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement