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.Windows.Forms;
- using MySql.Data.MySqlClient;
- namespace Gestao_de_Venda_de_Peixe
- {
- public partial class Form8 : Form
- {
- private MySqlConnection mConn;
- private MySqlDataAdapter mAdapter;
- private DataSet mDataSet;
- public Form8()
- {
- InitializeComponent();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- MySqlConnection mConn = new MySqlConnection("Persist Security Info=False;server=localhost;database=gestaodevendadepeixe;uid=root");
- mConn.Open();
- MySqlCommand cmd = new MySqlCommand(" select * from login where Username='" + textBox1.Text + "'and PassWord='" + textBox2.Text + "'", mConn);
- MySqlDataReader dr;
- dr = cmd.ExecuteReader();
- int count = 0;
- while (dr.Read())
- {
- count += 1;
- } if (count == 1)
- {
- MessageBox.Show("ok");
- Form9 f9 = new Form9();
- f9.Show();
- this.Visible = false;
- }
- else if (count > 1)
- {
- MessageBox.Show("error");
- }
- mConn.Close();
- }
- private void textBox2_TextChanged(object sender, EventArgs e)
- {
- }
- private void Form8_Load(object sender, EventArgs e)
- {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement