Q: How can I assign values to attributes of an object?

Source: Internet
Author: User

Recently, I have just come into contact with "entity classes ".
There is a question, that is, the issue of assigning values to the attributes of an object.
For example, I have a student object class. Its attributes include studentid, studentname, studentsex, studentclass, and so on.
I need to assign a value to the corresponding lable in page_load:
For example:
This. lbl_studentid.text = student. studentid;
This. lbl_studentname.text = student. studentname;
This. lbl_studentsex.text = student. studentsex;
This. lbl_studentclass.text = student. studentclass;
.......
I wonder if the object class should be used like this?
When assigning values to attributes of an object, do I use the table in dateset to assign values to the expected attributes?
So what are the advantages of assigning values to controls using tables in dateset?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.