Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String^ esto = L"datasource=localhost;port=3306;username=root;password=guateumg";
- MySqlConnection^ conexion = gcnew MySqlConnection(esto);
- MySqlCommand^ cmdBaseDato = gcnew MySqlCommand("select * from temp.empleado where nombre = '" + this->usuario_txt->Text + "' and contrasenia = '" + this->contrasenia_txt->Text + "';", conexion);
- MySqlDataReader^ Lectura;
- try{
- conexion->Open();
- Lectura = cmdBaseDato->ExecuteReader();
- int contador = 0;
- while (Lectura->Read())
- {
- contador=1;
- if (contador == 1)
- {
- MessageBox::Show("Datos Ingresados Correctamente","Informacion");
- Administrador^ Admin = gcnew Administrador(); //va al otro form
- Admin->Show();
- }
- }
- if (contador == 0)
- {
- MessageBox::Show("Alguno Datos No Concuerdan Con Nuestra Base De Datos","Informacion");
- usuario_txt->Clear();
- contrasenia_txt->Clear();
- }
- }
- catch (Exception^ error){
- MessageBox::Show(error->Message);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement