473,406 Members | 2,345 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

'inaccessible due to its protection level' Error

I have a VB background and am developing a new windows app in Csharp.
I'm getting the error.

'inaccessible due to its protection level'

I've added a TextBox1 and a Button1 to a form.

I double click the Button1 button.

inside the method I type

string strName;
strName = TextBox1.text;
when I go into debug mode I get the error.
'inaccessible due to its protection level'

and TextBox1.text is highlighted.


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #1
1 17201
On the contrary to VB.NET, C# is case sensitive, so change ".text" to
".Text". Otherwise the C# compiler thinks that you are trying to access a
protected member variable of the Control class which happens to have the
"text" name.

--

Carlos J. Quintero

MZ-Tools 4.0: Productivity add-ins for Visual Studio .NET
You can code, design and document much faster.
http://www.mztools.com
"Larry" <do********@nospamhere.com> escribió en el mensaje
news:%2******************@TK2MSFTNGP15.phx.gbl...
I have a VB background and am developing a new windows app in Csharp.
I'm getting the error.

'inaccessible due to its protection level'

I've added a TextBox1 and a Button1 to a form.

I double click the Button1 button.

inside the method I type

string strName;
strName = TextBox1.text;
when I go into debug mode I get the error.
'inaccessible due to its protection level'

and TextBox1.text is highlighted.


Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: BlueOysterCult | last post by:
Hello I can't get around the error "inaccessible due to its protection level" - it points at a line that I am using .Sort() and BinarySearch() - but the real problem lies in another part of the...
1
by: Larry | last post by:
Thanks in advanced for your help I've added a TextBox1 and Button1 to a form in C# in VS.net 2003. When I double click on the Button1 at design time, a private method ButtonClick. I've...
1
by: Chris | last post by:
Hi, New to C# programming. I'm trying to implement some simple security in my website. Basically a user cannot surf to secured aspx pages simply by accessing them directly through the address...
3
by: tshad | last post by:
I am getting a message for my objects that say: testNulls.cs(13,33): error CS0122: 'FtsData.IntType.IntType()' is inaccessible due to its protection level I have a class calling objects out of...
2
by: Jason Shohet | last post by:
I have a line: public System.Web.UI.HtmlControls.HtmlTable bldgInfo; Even though its public, for some reason every so often, .NET tells us that bldgInfo table is inaccessible due to the...
1
by: Arjen | last post by:
Hi, I have this inside a webusercontrol: private string MenuItem = new string; Inside the .ascx file I do this: <%= MenuItem(0) %> And I get this error: ....is inaccessible due to its...
2
by: sck10 | last post by:
Hello, I am getting the following error: fvServiceIdea_ItemUpdating_Validate(object, System.Web.UI.WebControls.FormViewUpdateEventArgs)' is inaccessible due to its protection level. Below...
5
by: Iain | last post by:
Hi All I have the code below (Using Delphi 2006 Developer to create an C# ASP.Net page to update a simple database table. When the page is fired I get the following error message ...
6
by: milund | last post by:
I have a "funny" after upgrading to .NET2.0. The following code is placed inside an unsafe method in assembly "A" System.Object myIUnknownObject =...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.