Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 10th, 2011, 06:52 PM
Authorized User
Points: 139, Level: 2
Points: 139, Level: 2 Points: 139, Level: 2 Points: 139, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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.
  #2 (permalink)  
Old October 11th, 2011, 09:59 AM
Rod Stephens's Avatar
Wrox Author
Points: 3,166, Level: 23
Points: 3,166, Level: 23 Points: 3,166, Level: 23 Points: 3,166, Level: 23
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2006
Location: , , .
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!)
  #3 (permalink)  
Old October 11th, 2011, 11:09 AM
Authorized User
Points: 139, Level: 2
Points: 139, Level: 2 Points: 139, Level: 2 Points: 139, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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.
  #4 (permalink)  
Old October 11th, 2011, 12:34 PM
Rod Stephens's Avatar
Wrox Author
Points: 3,166, Level: 23
Points: 3,166, Level: 23 Points: 3,166, Level: 23 Points: 3,166, Level: 23
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2006
Location: , , .
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!)
  #5 (permalink)  
Old October 11th, 2011, 02:49 PM
Authorized User
Points: 139, Level: 2
Points: 139, Level: 2 Points: 139, Level: 2 Points: 139, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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.
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 09:03 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.