title: How does one loop through the tables of a database in ASP.NET (WebMatrix)?
body: <p>SOLVED (my own problem):</p>
  
  <p><code>SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES</code></p>
  
  <p>This worked for me.</p>
  
  <hr>
  
  <p>As following the tutorial on the Microsoft website <a href="http://www.microsoft.com/web/post/web-development-101-part-5-using-data#_Toc281081979" rel="nofollow">here</a>, I've found it quite easy to loop through the rows of a table using the following code.</p>
  
  <pre><code> @{
     var data = Database.Open("FullDatabase").Query("SELECT * FROM Servers");
   } 
  
  &lt;div id="movieslist"&gt;
      &lt;ol&gt;
          @foreach(var row in data)
          {
          &lt;li&gt;&lt;a href="#"&gt;@row.Item&lt;/a&gt;&lt;/li&gt;
          }
      &lt;/ol&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Which outputs the following:</p>
  
  <pre><code>1. Virtual Machines
  
  2. Physical Machines
  
  3. Processors (CPU)
  
  4. Memory (RAM)
  
  5. OS Build
  </code></pre>
  
  <p>However, the "Servers" table is just one of many in the database. What I would love to do is something like this:</p>
  
  <pre><code> @{
     var database = Database.Open("FullDatabase")
   } 
  
  &lt;div id="movieslist"&gt;
      &lt;ol&gt;
          @foreach(var table in database)
          {
          var data = database.Query("SELECT * FROM " + table);
              @foreach(var row in data)
              {
              &lt;li&gt;&lt;a href="#"&gt;@row.Item&lt;/a&gt;&lt;/li&gt;
              }
           }
      &lt;/ol&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Is such a thing possible? If so how? Thanks very much.</p>