DataAccessLayer.DataBase.UpdateAvatar C# (CSharp) Method

UpdateAvatar() public method

public UpdateAvatar ( System.Guid accountId, byte Image, string mimeType ) : bool
accountId System.Guid
Image byte
mimeType string
return bool
        public bool UpdateAvatar(Guid accountId, byte[] Image, string mimeType)
        {
            var queryString =
                 "UPDATE [dbo].[accounts] " +
                     "SET [photo] = @photo " +
                     ",[mimetype] = @mimetype " +
                 "WHERE [dbo].accounts.accountid = @accountid";

            using (SqlConnection connection = new SqlConnection(_connectionString))
            {
                var command = new SqlCommand(queryString, connection);
                command.Parameters.AddWithValue("photo", Image);
                command.Parameters.AddWithValue("mimetype", mimeType);
                command.Parameters.AddWithValue("accountid", accountId);

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

                return true;
            }
        }