By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,343 Members | 925 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,343 IT Pros & Developers. It's quick & easy.

Name '_txtCompany' is not declared

P: n/a
As I run the program , there is always error 'Name '_txtCompany' is not
declared
I didn't modify found, i can't find any named "_txtCompany" in my program
I check "txtCompany" , this textbox seems quit ok , nothing special.
What is "_txtCompany" ??
please help
Nov 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Hi Agnes,

Sometimes when you use the designer and delete things there stay some parts,
do not ask me when, mostly is it because you have added something what you
would not do twice or something.

Can you open the designer part (the +) and than check again on that.

You can also do a check on your complete project if it is maybe on an orphan
dataset.vb in your project.

Cor
As I run the program , there is always error 'Name '_txtCompany' is not
declared
I didn't modify found, i can't find any named "_txtCompany" in my program
I check "txtCompany" , this textbox seems quit ok , nothing special.
What is "_txtCompany" ??
please help

Nov 20 '05 #2

P: n/a
* "Agnes" <ag***@dynamictech.com.hk> scripsit:
As I run the program , there is always error 'Name '_txtCompany' is not
declared
I didn't modify found, i can't find any named "_txtCompany" in my program
I check "txtCompany" , this textbox seems quit ok , nothing special.
What is "_txtCompany" ??


Does doubleclicking the error bring you to the line where the error
occured? I assume that it's a compile-time error.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 20 '05 #3

P: n/a
As i double click, it didn't point out anything...

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> ???
news:%2***************@TK2MSFTNGP12.phx.gbl ???...
* "Agnes" <ag***@dynamictech.com.hk> scripsit:
As I run the program , there is always error 'Name '_txtCompany' is not
declared
I didn't modify found, i can't find any named "_txtCompany" in my program I check "txtCompany" , this textbox seems quit ok , nothing special.
What is "_txtCompany" ??


Does doubleclicking the error bring you to the line where the error
occured? I assume that it's a compile-time error.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 20 '05 #4

P: n/a
Agnes wrote:
As I run the program , there is always error 'Name '_txtCompany' is not
declared
I didn't modify found, i can't find any named "_txtCompany" in my program
I check "txtCompany" , this textbox seems quit ok , nothing special.
What is "_txtCompany" ??
please help


I too get this same error. To fix it I go into the " Windows Form
Designer generated code " Region of the code behind the form, and change
the line

Friend WithEvents txtCompany As System.Windows.Forms.TextBox

to

Friend WithEvents txtCompany2 As System.Windows.Forms.TextBox

move off the line (just up/down arrow), then go back (down/up) and
change it back to

Friend WithEvents txtCompany As System.Windows.Forms.TextBox

and it compiles.
This is surely a bug in VS.NET (or the compiler), and I hope it's fixed
in 2005. If not before, as I get it in about 3 or 4 files, which are
read-only (under source control - VSS 6.0d), so can't possibly have
changed since the last successful compile (about 1 minute previous). It
occurs about 1 in every 3 compiles.
Nov 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.