Wrox Programmer Forums
|
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0
This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 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 November 24th, 2008, 03:01 PM
kss kss is offline
Authorized User
 
Join Date: Nov 2008
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Lee,
I caught that, and made the correct changes. But I'm still getting the same exception.

And I believe it's on AspNetUserID, cuz in the command window it I try to debug.print("AspNetUserID") I get the exception but if I debug.print on the UserName, it is returned, to the command window.
The AspNetUserID can not be null in my db table.
Out of all the fields that my Stored proc returns only 2 can be nulls (middlename and phone2)

Thanks everyone for you help, suggestions and guidance.
Kss.

 
Old November 24th, 2008, 03:06 PM
kss kss is offline
Authorized User
 
Join Date: Nov 2008
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Could the fact that AspNetUserID is a guid, have anything to do with it? When I do reader("AspNetUserID") do I need to do anything to cast this as a guid like I do with my booleans and dates.

 
Old November 24th, 2008, 03:49 PM
Lee Dumond's Avatar
Wrox Author
 
Join Date: Jan 2008
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
Default

Yeah, you would want to do that, though I'm not sure this relates to the problem at hand. The following code should accomplish that.

Code:
Protected Overridable Function GetUserFromReader( _
                ByVal reader As IDataReader) _
                As UsersDetails

   Dim userId As New Guid(reader("AspNetUserId").ToString)

   Return New UsersDetails( _
     userId, _
     reader("UserName").ToString(), _
     reader("FirstName").ToString(), _
     
     etc...
End Function
_________________________________

Visit my blog at http://leedumond.com
 
Old November 24th, 2008, 03:59 PM
kss kss is offline
Authorized User
 
Join Date: Nov 2008
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Awesome thanks.

Figuered it out, stupid mistake on my part.
reader("xxx") the "xxx" needs to be the actual fields from your stored proc. not what you are using in your object.

It's alway the simple stupid stuff that gets you.
Thanks all.
Greatly appreciated.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with BLL and DAL kss BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 0 November 20th, 2008 09:23 PM
DAL to BLL rodmcleay LINQ 3 June 2nd, 2008 12:15 PM
breaking bll and dal into separate projects tony20501 BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 5 November 29th, 2007 12:29 PM
Why not using a common detail class for DAL BLL Ghistos BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 1 April 17th, 2007 01:04 AM
Redundancy in DAL/BLL classes Mourad BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 1 March 8th, 2007 10:39 PM





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