title: C# how to output all the items in a class(struct)
body: <p>i have class basically just a row of a table. 
  this row contains many columns. </p>
  
  <p>for testing purpose, i  will need to output the reads i get .</p>
  
  <p>so i need to output all of the columns in the row.</p>
  
  <p>the class is like </p>
  
  <pre><code>    public class tableRow
      {
          public tableRow()
          {}
      public string id
      public string name
      public string reg
      public string data1
      ....
      ....
      ....
     &lt;lot more columns&gt;
  
  }  
  </code></pre>
  
  <p>then i need to write like:</p>
  
  <pre><code>Console.WriteLine("id: " + tableRow.id);
  Console.WriteLine("name: " + tableRow.name);
  Console.WriteLine("reg: " + tableRow.reg);
  Console.WriteLine("data1: " + tableRow.data1);
  ...
  ...
  ...
  &lt;lot more Console.WriteLine&gt;
  </code></pre>
  
  <p>So i want to know ,  is there an easy way to get all of these output , without so much console.writeLine?</p>
  
  <p>thanks</p>