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

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -