H
Howard
I need to write a web page that outputs a table from database. ( i want to
write my own code, don't want to use the built-in control)
I came up with two ways of doing this (i use c# 2.0)
1.
pesudo code
sqlstringTable = "select category_name from table1"
execute(sqlstringTable)
while(read)
{
output category name
sqlstringTable = "select * from table2"
execute(sqlstringTable2)
while(read)
{
output values of all cell in this row
}
}
2.
sqlstringTable = "select category_name from table1"
execute(sqlstringTable)
while(read)
{
store information to <list>category
}
for (i=0 i<=size of <list>category; i++
{
sqlstringTable = "select * from table2"
execute(sqlstringTable2)
while(read)
{
store to <list>row
}
}
use nested for loops to output <list>category with corresponding <list>row
Method 1 is how i would normally write this. but since im getting into c#
2.0 i want to try out this new feature. did i understand this correctly?
Also any memory used to store <list> will be released after the page is
loaded correct?
Howard
write my own code, don't want to use the built-in control)
I came up with two ways of doing this (i use c# 2.0)
1.
pesudo code
sqlstringTable = "select category_name from table1"
execute(sqlstringTable)
while(read)
{
output category name
sqlstringTable = "select * from table2"
execute(sqlstringTable2)
while(read)
{
output values of all cell in this row
}
}
2.
sqlstringTable = "select category_name from table1"
execute(sqlstringTable)
while(read)
{
store information to <list>category
}
for (i=0 i<=size of <list>category; i++
{
sqlstringTable = "select * from table2"
execute(sqlstringTable2)
while(read)
{
store to <list>row
}
}
use nested for loops to output <list>category with corresponding <list>row
Method 1 is how i would normally write this. but since im getting into c#
2.0 i want to try out this new feature. did i understand this correctly?
Also any memory used to store <list> will be released after the page is
loaded correct?
Howard