Guest User

Untitled

a guest
Dec 12th, 2017
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. System.Data.SqlClient.SqlException: 'Incorrect syntax near 'Schools'.'
  2.  
  3. sda.Fill(dt);
  4.  
  5.  
  6.  
  7. SqlConnection con = new SqlConnection(@"Dont want to show my sql connection but it works -lol");
  8. SqlDataAdapter sda = new SqlDataAdapter(selectCommandText: "Select Count (*) lFrom Schools where Username='" + textBox1.Text + "' and Password='" + textBox2.Text + "' and Security='" + textBox3.Text + "' and SecurityQuestion='" + dropDown.selectedValue + "'", selectConnection: con);
  9. DataTable dt = new DataTable();
  10. sda.Fill(dt);
  11. if (dt.Rows[0][0].ToString() == "1")
  12. {
  13.  
  14. this.Hide();
  15.  
  16. Form1 ss = new Form1();
  17. ss.Show();
  18. }
  19. else
  20. {
  21. MessageBox.Show("Your Username Or Password Is Incorrect Please Try Again");
  22. }
  23. }
Add Comment
Please, Sign In to add comment