The procedure is pretty simple. I load the classic asp page, I load the asp.net page, classic asp finished loading in 5 second. asp.net finished in more than 20. They both display the same data however, as you can guess, the way to achieve that same result is different.
Just as an example, this is not the actual code but similar to one of the pages I am working on. The goal is to join 2 recordsets/datatable.
In asp, this block of code takes 2 seconds:
..................
....store order info in myRS.....
....store customer info in myTable.....
...................
Do while not myRS.eof
myTable.open "select customername from tblCustomer where customerID=" & myRS.fields("CustomerID"), myConnection
myArray(0,ubound(myArray,2))=myRS.fields("Ordernumber")
myArray(1,Ubound(myArray,2))=myRS.fields("OrderDate")
myArray(2,Ubound(myArray,2))=myTable.fields("CustomerName")
myTable.close
myRS.movenext
loop
In asp.net, this block of code takes over 40 seconds:
trace.warn("open conn: " & now)
..................
....store order info in datatable myDataTable.....
....store customer info in datatable myCustomer.....
...................
myDataView=new DataView(myCustomer)
for each myRow in myDataTable.rows
myDataview.rowFilter="CustomerID=" & myRow("CustomerID")
myRow("CustomerName")=myDataview(0).row("Customername")
next
trace.warn("finish looping: " & now)
FYI, heres the trace info:
open conn: 9/19/2002 4:24:02 PM 0.145755 0.113731
finish looping: 9/19/2002 4:24:45 PM 42.584835 33.638436
So why? My statement about their performance is solely based on comparing pages I have written in asp and asp.net. Again I am new to .net, possibly I am not coding it the right way but I assure you I have tried looking for other ways. If I use a datareader instead of dataview, request timed out. I tried using command.executescalar but the customername always comes out null. If you do see what I am doing wrong, please tell me what it is. =)