Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8
This is the forum to discuss the Wrox book Beginning ASP.NET 2.0 by Chris Hart, John Kauffman, David Sussman, Chris Ullman; ISBN: 9780764588501
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 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 December 12th, 2005, 03:26 PM
Registered User
 
Join Date: Dec 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Page 201 Try It Out

After I update the record I get this error:
Must declare the scalar variable "@original_PlayerID".

?????Help

Thanks in advance,

mshytech
 
Old December 14th, 2005, 02:43 AM
Registered User
 
Join Date: Dec 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I had the same error. I fooled around with the code and changed the end of line 51 from:

WHERE [PlayerID] = @original_PlayerID

to:

WHERE [PlayerID] = @PlayerID

...that seemed to do the trick. Hope that helps.
 
Old December 14th, 2005, 02:19 PM
Registered User
 
Join Date: Dec 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks. It works. Have a great day!

 
Old January 3rd, 2006, 05:26 AM
Registered User
 
Join Date: Jan 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i don't think this is the right way, if change the original_playerid become playerid, all the records will be changed.....

i think it should be:

added this line

<asp:ControlParameter Name="Original_PlayerID" Type="String" ControlID="GridView1" PropertyName="SelectedValue"></asp:ControlParameter>


after line 60 <UpdateParameters>

 
Old January 16th, 2006, 12:31 PM
Wrox Author
 
Join Date: Jun 2004
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This is a bug in the auto-generated code! Somehow some old code has sneaked through. The first solution given here is indeed right, there is no @original_playerid, and so you can safely change it to @PlayerId. There is no need to add a ControlParameter. I believe Dave Sussman is at this moment reworking the chapter for the C# version and he will add some more to this thread (as well as making sure it's corrected in the code) about this matter.

Chris

Chris Ullman
Programmer/Technical Author
http://www.cuasp.co.uk





Similar Threads
Thread Thread Starter Forum Replies Last Post
access C#.Net page as action of calssic ASP page mansharma_s ASP.NET 1.x and 2.0 Application Design 6 January 7th, 2008 10:58 AM
Chapter 6, page 201,Try it out does not work. VictorVictor BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 2 January 30th, 2006 02:20 PM





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