variable 'Name' conflicts with property 'Name'

Chong

Regular
Joined
Apr 4, 2003
Messages
79
I'm getting an error when I run the program with the following message:

C:\VB_Project\Computers\mainForm.vb variable 'Name' conflicts with property 'Name' in the base class 'Control' and so should be declared 'Shadows'.
C:\VB_Project\Computers\mainForm.vb(1107): Value of type 'String' cannot be converted to 'System.Windows.Forms.DataGridTextBoxColumn'.\

And when I look at line 1107, there's this code:

Me.Name = "mainForm"

If I delete this line or comment it out then the program runs fine but with a warning about conflict variable name. However, after a couple of runs, the program will generate the same exact above error again. And this time, if I look at the line, 1107, again, the code Me.Name = "mainForm" is back.

Does anyone have any suggestion why this happened? If anyone wish to see my whole project to help me diagnose, I'm willing to attach it in here or send it to you. I'm greatly appreciate for any help I can get.

Thank you,

ljCharlie
 
if i read ur question correctly here's what i think:


when u run ur project, it will ask you something like, "sub main was not found, run anyway?" <-- im doin this off the top of my head, so excuse me if im wrong about the mesage

click no

in the error box at the bottom, double click the one that says something about "sub main was not found in (yourprojectname)"

a dialog box will popup, select the form that u want to startup and ur done

sorry if i misnterpreted ur question, im not too sure what u mean
 
Thank you very much for the help. I found out that I have a veriable name called "Name" which is a reserved word.

It's working now.

Thanks!

ljCharlie
 
Back
Top