For all the lines marked with a red line comment, the error arises. I'd like to know why txtDiscountAmount.Text is recognized, but let's say txtNumberOfInvoices.Text isn't.

Thanks for reading.

01-08-2011

vart

this is partial class

form member definition is located in another cs file generated by form designer. check it to see which txt member variables are available and what are their names

01-08-2011

Xfer

I actually figured that out, completely forgetting about the form designer. Thanks anyways.

But a new problem emerged. After adding the missing txt variables, warnings came about. They stated

Code:

"member variable Is never assigned to and will always have its default value of null"

Anyone know what's going on here?

01-08-2011

VirtualAce

Are you setting the new variables to null? You should always set your variables to null or some value prior to using them in C#. You are using one of the new variables without first assigning it a value which in essence could cause an error later if the compiler wasn't so nice as to assign a default value to it for you.

01-08-2011

Shakti

Warnings like that should be taken very seriously.

Im going to go out on a limb and guess that you want
txtNumberOfInvoices
and all the other red lines to be some sort of control, textbox or label or something? You probably want to add those to the form using the designer, you can name them by changing the Name parameter in the Properties dialog for the control.