ASP.NET question (looping inside a table) [Archive] - C Board

PDA

View Full Version : ASP.NET question (looping inside a table)


Rainbowinblack
03-06-2008, 03:10 PM
I know it's a C# forum,
but i have a problem making a ASP.NET website using C#

i have a SqlConnection in C#,
and i want to make a table using the data from that connection,

(i know php) so i created a table and inside that table i wrote

<% for (int i = 1; i < 10;i++)
{ %>

asp html script for row and cell comes here
then - <% data to import from the connection using "i" as reference %>
close row

then ending the for loop - <% } %>


looping like this worked outside a table...but inside a table VS2005 says i cant use code...

so if i cant use code - how can i insert data from tables or datatables into the table rows?
(that's how it's done in php.....)

Thanks
Roy