c# - Representing data in array or collection to iterate -
very basic question... have records
| fname | lname | designation | comment | | | aa | aaa | aaaa | | b | bb | bbb | bbbb | | c | cc | ccc | cccc |
i need iterate of these in loop... 1 method create class , make array of objects iterate through.. this
class person { string fname {set; get;} string lname {set; get;} string designation {set; get;} string comment {set; get;} } person [] person = new person[3]; for(int x = 0; x < 3; x++) { person[x].fname = "asd"; }
is there other make array of strings or collection don't have make class...
c# anonymous types might choice.
var v = new { amount = 108, message = "hello" }; console.writeline(v.amount + v.message);
Comments
Post a Comment