Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Basics
| Search | Today's Posts | Mark Forums Read
ASP.NET 3.5 Basics If you are new to ASP or ASP.NET programming with version 3.5, this is the forum to begin asking questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Basics 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
  #11 (permalink)  
Old May 3rd, 2010, 12:01 PM
Authorized User
 
Join Date: Jun 2003
Location: , , .
Posts: 54
Thanks: 1
Thanked 0 Times in 0 Posts
Default


I forgot to add the parameter.

CmdGetPersonData.Parameters.Add(useridparam)

Thank you for your response. It was helpful in getting me to the root of the problem.
  #12 (permalink)  
Old May 3rd, 2010, 12:04 PM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

So, this doesn't have much to do with the ProviderUserKey, but with the rest of your code? That, once again, proves the importance of providing detailed explanations of the code and problem, backed up with relevant snippets as you did in your last post.

Code:
Dim useridparam As New SqlParameter("@userid", SqlDbType.UniqueIdentifier)
useridparam.Value = UserKey
An excellent SqlParameter you have here. And what a pity you completely forget about it after you create it. In other words, you're never adding it to the Parameters collection of the SqlCommand object.

Hope this helps,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
  #13 (permalink)  
Old May 3rd, 2010, 12:23 PM
Authorized User
 
Join Date: Jun 2003
Location: , , .
Posts: 54
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Yes you are correct. I got fooled by the watch window in the beginning.

Also, my Try Catch masked the problem.

The reason I didn't put in all of my code in the beginning was that I didn't want to clutter the post with stuff I thought wasn't relevant. A few lessons here: 1 A person doesn't know what they don't know. 2. Do more debugging before posting.

In any case, you were very helpful. Thank you. Steve
  #14 (permalink)  
Old May 3rd, 2010, 12:25 PM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

And 3) Don't be crumpy..... ;-)

Glad you got it sored out.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
  #15 (permalink)  
Old May 3rd, 2010, 12:36 PM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

You are never passing the parameter you create to the command object.. Did you realize that???
__________________
HTH

Gonzalo


================================================== =========
Read this if you want to know how to get a correct reply for your question.
(Took that from Doug signature and he Took that from Peter profile)
================================================== =========
My programs achieved a new certification :
WORKS ON MY MACHINE
================================================== =========
I know that CVS was evil, and now i got the
proof.
================================================== =========




Similar Threads
Thread Thread Starter Forum Replies Last Post
Create user wizard-check existing user sophia BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 8 January 17th, 2010 07:37 AM
login failed for user Domain\User ID GailCG SQL Server 2005 0 June 29th, 2009 10:45 AM
Read Only Form Is not Read only lryckman Access VBA 3 June 12th, 2007 06:30 AM
login failed for user domain\user babakwx SQL Server 2000 2 May 30th, 2006 12:28 PM
Run DTS with a windows user, not a SQL user Kalli SQL Server DTS 1 September 15th, 2005 11:53 PM





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