Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public partial class Form1 : MetroFramework.Forms.MetroForm
- {
- public Form1()
- {
- InitializeComponent();
- }
- SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)v11.0;AttachDbFilename=C:UsersIgurekDocumentsDatabase.mdf;Integrated Security=True;Connect Timeout=30");
- private void metroButton1_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- private void metroButton2_Click(object sender, EventArgs e)
- {
- SqlDataAdapter sdf = new SqlDataAdapter("Select Count(*) From Login where Username='" + metroTextBox1.Text + "' and Password='" + metroTextBox2.Text + "'", con);
- DataTable dt = new DataTable();
- sdf.Fill(dt); // <--------- Here's the exception
- if (dt.Rows.Count == 1)
- {
- Form1 f1 = new Form1();
- f1.Show();
- }
- else
- {
- MessageBox.Show("Sprawdz Nazwe i Haslo");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement