List<user> list=new list<user> () When a list is loaded with a class, it is easy to make mistakes, the value of the attention

Source: Internet
Author: User

DateTime Time ;

// defines a UserInfo class A list collection of types that puts the Results of the query into the list set , and the list inside is a collection;

list<UserInfo> list = wylm. executequery<user> ("select * from User where User id= ' {0} ' " , ID). ToList ();

if (list. Count > 0)

 {     

//list[0] is a UserInfo object, because the object contains properties, methods, fields, etc., so applyevaluation refers not to a single property, but rather list[0] is an object of the list collection; to fetch list[0] The time property of the column is obtained by applyevaluation.time ; the novice is easily mistaken here;

UserInfo applyevaluation = list[0];

Time = Applyevaluation.time;

}

List<user> list=new list<user> () When a list is loaded with a class, it is easy to make mistakes, the value of the attention

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.