Click here to Skip to main content
15,896,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
messageBox.Show("student First Name: " + aryStudent[i].getFirstName + "\r\n student Last Name: " + aryStudent[i].getLastName() + "\r\n student number: " + aryNumber[i].getNumber, "student " +i.tostring(), MessageboxButtons...

C#
"Student First Name: " +aryStudent[i].getFirstName

-is the red underlined
if i put the brackets after .getFirstName then the red line covers up to .getNumber

i have everything else under control.
it is to place a student name and number into a textbox for my class at TAFE
Please help if you see anything wrong
Posted
Updated 22-Apr-14 22:44pm
v2
Comments
phil.o 23-Apr-14 4:46am    
Which type does aryStudent[] hold?
For this type, what is the definition of getFirstName? Is this a method? A property?
When your code is "red underlined", what is the error message it gives to you?

1 solution

I guess that getFirstName and getNumber are methods. So, you have to call them using parenthesis. Something like:


C#
messageBox.Show("student First Name: " + aryStudent[i].getFirstName() + "\r\n student Last Name: " + aryStudent[i].getLastName() + "\r\n student number: " + aryNumber[i].getNumber(), "student " +i.tostring());
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900