Advertisement
Guest User

Untitled

a guest
Sep 21st, 2016
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. Additional information: Could not find specified column in results: admin
  2.  
  3. public int getLevel()
  4. {
  5. string sqlCommand = "Select level from users where username = 'admin'";
  6. int value = 0;
  7.  
  8. MySqlConnection con = new MySqlConnection("host=45.37.80.181;user=admin;password=V9_PfUYP2gqG!cuJTgyh;database=tcg;");
  9. MySqlCommand cmd = new MySqlCommand(sqlCommand, con);
  10.  
  11. con.Open();
  12.  
  13. MySqlDataReader reader = cmd.ExecuteReader();
  14.  
  15. while (reader.Read())
  16. {
  17. value += int.Parse(reader.GetString("admin"));
  18. }
  19. return value;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement