Wrox Programmer Forums
|
BOOK: Stephens' C# Programming with Visual Studio 2010 24-Hour Trainer
This is the forum to discuss the Wrox book Stephens' C# Programming with Visual Studio 2010 24-Hour Trainer by Rod Stephens; ISBN: 9780470596906
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Stephens' C# Programming with Visual Studio 2010 24-Hour Trainer 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 October 10th, 2011, 06:52 PM
Authorized User
 
Join Date: May 2011
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Default Lesson 36 Tryit

Right after I add the if statement for the dialog box for this project, I get an error stating that the text box is inaccessible due to its protection level. I'ved tried changing the modifier from private to public on the main form, and within the pop up form, but still getting the error. I downloaded the Tryit from 35, and started there but same error. Not sure what else could be causing it.
 
Old October 11th, 2011, 09:59 AM
Rod Stephens's Avatar
Wrox Author
 
Join Date: Jan 2006
Posts: 647
Thanks: 2
Thanked 96 Times in 95 Posts
Default

So it's this statement where it complains, right:

Code:
string filter = "State = '" + dlg.stateTextBox.Text + "'";
It sounds like the stateTextBox control on the dialog doesn't have the public modifier. I would double check that. Be sure it's set to "public" or "internal" not "protected" or something else.

If that doesn't work, post here again and we'll look more closely at the issue. Off hand I can't think why else you would be getting that error here.
__________________
Rod

Rod Stephens, Microsoft MVP

Essential Algorithms: A Practical Approach to Computer Algorithms

(Please post reviews at Amazon or wherever you shop!)
 
Old October 11th, 2011, 11:09 AM
Authorized User
 
Join Date: May 2011
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Default

By checking the modifier, I assume you're referring to the form.cs associated with the dialoug form, or is there a field in the propeties that controls that.
 
Old October 11th, 2011, 12:34 PM
Rod Stephens's Avatar
Wrox Author
 
Join Date: Jan 2006
Posts: 647
Thanks: 2
Thanked 96 Times in 95 Posts
Default

Open the dialog's form in the form editor. Click on the stateTextBox control and find the Modifiers property in the Properties window. If it doesn't say Public, change it to Public and hopefully you'll be all set.
__________________
Rod

Rod Stephens, Microsoft MVP

Essential Algorithms: A Practical Approach to Computer Algorithms

(Please post reviews at Amazon or wherever you shop!)
 
Old October 11th, 2011, 02:49 PM
Authorized User
 
Join Date: May 2011
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Rod, that did the trick. I had a feeling it was something easy. Thanks for your help.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 2 page 36 error BobDavis73 BOOK: Beginning Android Application Development 1 June 26th, 2011 04:23 PM
Chapter 24 Tryit objects not showing up Mark P. BOOK: Stephens' C# Programming with Visual Studio 2010 24-Hour Trainer 6 June 24th, 2011 02:15 AM
Chapter 10 Tryit Mark P. BOOK: Stephens' C# Programming with Visual Studio 2010 24-Hour Trainer 3 June 20th, 2011 08:20 PM
Page 36 errata Patrick Cambria BOOK: Professional Visual Basic 2008 ISBN: 978-0-470-19136-1 0 December 24th, 2008 09:13 AM





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