Guest User

Untitled

a guest
Jun 21st, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. #region 驗證帳號重複
  2. public bool CheckAccount(string UserAccount)
  3. {
  4. using (SqlConnection con = new SqlConnection(DBConnection.ConnectString))
  5. {
  6. SqlCommand cmd = new SqlCommand(SPName.User.CheckAccount_Get, con);
  7. cmd.CommandType = CommandType.StoredProcedure;
  8. con.Open();
  9. cmd.Parameters.AddWithValue("@UserAccount", UserAccount);
  10. using (SqlDataReader dr = cmd.ExecuteReader())
  11. {
  12. while (dr.Read())
  13. {
  14. if (dr.HasRows)
  15. {
  16. return true;
  17. }
  18. }
  19. return false;
  20. }
  21. }
  22. }
  23. #endregion
Add Comment
Please, Sign In to add comment