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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.