Name '_txtCompany' is not declared

  • Thread starter Thread starter Agnes
  • Start date Start date
A

Agnes

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
 
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
 
* "Agnes said:
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.
 
Agnes said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top