Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- using MySql.Data.MySqlClient;
- namespace WindowsFormsApplication3
- {
- public partial class Form1 : Form
- {
- MySqlConnection conexion = new MySqlConnection("Server=localhost;Database=test;username=root;password=")
- public Form1()
- {
- InitializeComponent();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- conextion.Open();
- MessageBox.Show("Debug 1");
- MySqlCommand cmd = new MySqlCommand("SELECT * FROM users WHERE Name = '"+ username.Text+"' AND Password = '"+ password.Text+"' ");
- MySqlDataReader leer = cmd.ExecuteReader();
- MessageBox.Show("Debug 2");
- if (leer.Read())
- MessageBox.Show("Succes");
- else
- MessageBox.Show("Fail haha :))");
- conextion.Close();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement