Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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);
- private: System::Void loginbutton_Click(System::Object^ sender, System::EventArgs^ e) {
- String^ constring = L"datasource=localhost;port=3306;username=root;password=root;database=bd";
- MySqlConnection^ conDataBase = gcnew MySqlConnection(constring);
- MySqlCommand^ cmdDataBase = gcnew MySqlCommand("select * from users where login='" + this->logintextbox->Text + "' and pass ='" + this->passtextbox->Text + "';", conDataBase);
- MySqlDataReader^ myReader;
- try {
- conDataBase->Open();
- myReader = cmdDataBase->ExecuteReader();
- int count = 0;
- while (myReader->Read()) {
- count++;
- }
- if (count == 1) {
- MessageBox::Show("Corect!");
- }
- else MessageBox::Show("Username and pass is not corect!");
- }
- catch (Exception^ex)
- {
- MessageBox::Show(ex->Message);
- }
- };
Add Comment
Please, Sign In to add comment