Wrox Programmer Forums
|
BOOK: Professional ASP.NET 3.5 : in C# and VB ISBN: 978-0-470-18757-9
This is the forum to discuss the Wrox book Professional ASP.NET 3.5: In C# and VB by Bill Evjen, Scott Hanselman, Devin Rader; ISBN: 9780470187579
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET 3.5 : in C# and VB ISBN: 978-0-470-18757-9 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 18th, 2010, 09:12 PM
Registered User
 
Join Date: Feb 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 16 Error? - Missing RTrim

Sorry if this has been covered before... or if I've simply done something wrong, but I couldn't get the code on pages 580 & 581 to work. In other words, my Website would not perform the way you told us to expect given your example code. After much trial and error, I found the problem. I *think* it came down to this:

photoAlbumOwner requires an RTrim performed on it before it can be accurately compared to User.Identity.Name.

I think I discovered the reason for this: You've told us to establish the UserName field in the PhotoAlbum Table as nvarchar(256) ... (see p. 578).

I discovered that the photoAlbumOwner string in your example would *begin* with the proper name... but that string would be padded with spaces *after* the name. On the other hand, "User.Identity.Name" contained only the 'name' itself; without any trailing spaces. Because of this, the only way for your pages 580 & 581 code to work, I had to apply an RTrim to photoAlbumOwner.

Once I changed the appropriate code to things like:
User.Identity.Name = RTrim(photoAlbumOwner) and
User.Identity.Name <> RTrim(photoAlbumOwner)
...I found my Website was navigating in the way you told us it should.

Am I being crazy here? I'm thinking that since this is not in the Errata, I'm thinking I must have done something wrong.

Have I? Thanks in advance.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Error in Source Code in Chapter 16 Lcstyle BOOK: Beginning Linux Programming, 4th Edition ISBN 978-0-470-14762-7 1 February 28th, 2009 10:14 AM
Search Error Chapter 16 EgoGen BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 0 June 12th, 2008 03:36 PM
Chapter 16 Sql connection error flashmanTom BOOK: Beginning Visual Basic 2005 ISBN: 978-0-7645-7401-6 1 May 22nd, 2008 05:04 PM
Chapter 16 forum - SQL error petefernando Beginning PHP 2 March 31st, 2006 01:23 AM
Chapter 16 missing sample code bruceaj VB.NET 2002/2003 Basics 3 June 18th, 2003 08:18 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.