DataAccessLayer.DataBase.UpdateRole C# (CSharp) Method

UpdateRole() public method

public UpdateRole ( System.Guid accountId, int roleCode ) : bool
accountId System.Guid
roleCode int
return bool
        public bool UpdateRole(Guid accountId, int roleCode)
        {
            var queryString =
                 "UPDATE [dbo].[UsersRoles] " +
                 "SET RoleId = @roleid " +
                 "WHERE [dbo].UsersRoles.AccountId = @AccountId";

            using (SqlConnection connection = new SqlConnection(_connectionString))
            {
                var command = new SqlCommand(queryString, connection);

                command.Parameters.AddWithValue("roleid", roleCode);
                command.Parameters.AddWithValue("AccountId", accountId);

                try
                {
                    connection.Open();
                    return command.ExecuteNonQuery() > 0;
                }
                catch (Exception)
                {
                    throw;
                }
            }
        }