Well we've all heard of the wonderful Datagrid in ASP.Net and it's pretty handy to say the least. Then again some of you like me may still be stuck with poor old ASP for the moment. But it's not all bad. With vbscript classes in ASP you can acomplish many things. So I got the urge to try and create my own version of the datagrid.
To create a DataGrid class my first problem was efficiency. When learning how
to get records from a database and display them in a table on your asp page you'll
quite often do it like this:- <table>
<%
Do Until objRec.EOF
%>
<tr>
<td><%=objRec("name") %></td>
<td><%=objRec("address") %></td>
<td><%=objRec("email") %></td>
</tr>
<%
objRec.movenext
loop
%>
</table>
This is quite an innefficient way of doing things. A more efficient way of doing
things is to use the RecordCount
property of the Recordset, for
x = 0
to objRec.RecordCount
.
Comments