Jump to content

[SOLVED] [ASP.NET 3.5] building tables manually OR 3 data sources for 1 table


Recommended Posts

I have a PHP script that build 3 arrays from SQL queries. A table is built with the header built from 1 array, the rows labeled with the second array and the table filled in with a binary value show weather the combination exists.

This may explain it better:

echo "<tr>";
foreach($A1 as $x1){
   echo "<th>$x1</th>";
}
echo "</tr>";
foreach($A2 as $x2){
   echo "<tr>";
   echo "<td>$x2</td>";
   if(in_array($x1.$x2, $A3)){
      echo "<td>X</td>";
   }else{
      echo "<td> </td>;
   }
   echo "</tr>";
}

Basically, its graphing out what services are available in what areas.

 

The Problem: I am trying to re-create this in ASP.NET 3.5.

I keep seeing people poo-pooing Response.Write. Is there a good way to build the table manually like this, or is there a "control" that would apply to this?

Not very active board I guess.

I got it figured out.

sqlDataSource returns a DataView.

DataView.Tables() returns a DataTable, which you can iterate with For Each ... Next accessing DataTable.rows and DataTable.columns.

 

I used Response.Write() not finding any other option or even any reason not to.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.