title: select sql table rows as columns for survey application
body: <p>I am developing a survey application, a very simple one that has two tables.</p>
  
  <p><code>table_survey_answers</code></p>
  
  <pre><code>+------------+------------+----------------+
  | customerid | questionID |     answer     |
  +------------+------------+----------------+
  |          1 |        100 | Good           |
  |          1 |        101 | Acceptable     |
  |          1 |        102 | Excellent      |
  |          2 |        100 | Not acceptable |
  |          2 |        101 | Acceptable     |
  |          2 |        102 | Good           |
  +------------+------------+----------------+
  </code></pre>
  
  <p><code>table_questions</code></p>
  
  <pre><code>+------------+-----------------------------------+
  | QuestionID |             Question              |
  +------------+-----------------------------------+
  |        100 | Kindly rate our customer service? |
  |        101 | How fast is our product delivery? |
  |        102 | Quality of the Product A?         |
  +------------+-----------------------------------+
  </code></pre>
  
  <p>Now I want display survey result as follow in asp.net gridview.</p>
  
  <pre><code>+------------+-----------------------------------+-----------------------------------+---------------------------+
  | CustomerID | Kindly rate our customer service? | How fast is our product delivery? | Quality of the Product A? |
  +------------+-----------------------------------+-----------------------------------+---------------------------+
  |          1 | Good                              | Acceptable                        | Excellent                 |
  |          2 | Not Acceptable                    | acceptable                        | Good                      |
  +------------+-----------------------------------+-----------------------------------+---------------------------+
  </code></pre>
  
  <p>I already created tables to get survey responses. Only thing I want export the result in gridview as explained above format.</p>