Abnormal value assigned


I have a label to hold the value of the Textbox, like

lb_var5.Text = tb_ite_from.Text;

Open in new window

Textbox is originally having the value of 5. But later on, when I retrieve the orginal value for Textbox, like

                                tb_ite_from.Text = lb_var5.Text;

Open in new window

I get 'bbbbbb' and I see no other coes to assign values to this Textbox. why does it happen?
LVL 11
HuaMinChenBusiness AnalystAsked:
Who is Participating?
Jacques Bourgeois (James Burger)Connect With a Mentor PresidentCommented:
Looking at the code is never sufficient, because things can be changed indirectly or through code that does not show directly the bbbbb. It could be hidden in a Sendkeys or a Chr call for instance. Or it could be changed by your "other deployed project".

The only way to really know what is happening is by trapping the event(s) that could lead you to what is happening just before the point at which the bad value appears in the control.
Julian HansenConnect With a Mentor Commented:
Have you done a search on your solution for the string 'bbbbbb'

What is triggering looking at the text value of the label? In other words - after you start the application is any input required before you run the code above.

What happens if you test the value immediately after setting it.

Have you stepped through your code with the debugger to see what is happening.

Can you post more of your code so we can get some idea of what is going on?
Jacques Bourgeois (James Burger)Connect With a Mentor PresidentCommented:
Put some code with a breakpoint in the TextChanged events of both the TextBox and the Label. When you hit the breakpoint, check the value. If it is bbbbbb, then look at the Call Stack to see what triggered the event with that value.
HuaMinChenBusiness AnalystAuthor Commented:
Sorry, I did not find out any place in which there is an assignment statement that is changing the value of lb_var5 other than the lines I showed above, within the project. I am afraid that I cannot directly run the project as within the project, there is a call to execute one other deployed project.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.