代码:
Dim dr As SqlDataReader = SQLHelper.ExecuteReader(conn, 1, "SELECT title FROM xxx ")
sb.Append("<table border='1'>")
While dr.Read()
sb.Append("<tr>")
sb.Append("<td>")
sb.Append(dr("Title").ToString())
sb.Append("</td>")
For i As Integer = 0 To toShowColumn - 2
If dr.Read() Then
sb.Append("<td>")
sb.Append(dr("Title").ToString())
sb.Append("</td>")
Else
sb.Append("<td> </td>")
End If
Next
sb.Append("</tr>")
End While
sb.Append("</table>")
dr.Close()
Response.write sb.ToString()