I have a repeater which takes 270 seconds to render and actually ends up crashing all browsers. The SQL to retrieve the data takes about 10 seconds. I wanted to remove the Eval’s to see if that speeds up things a bit, but I am having trouble with the correct syntax. I have doubts that this would actually improve performance as I am dealing with 150,000 records. Would a GridView or other control be faster? Would using LINQ to SQL improve performance? Here is the code for the Eval:
<%#Eval("Name")%>
I am trying:
<%# ((DataRowView)Container.DataItem)["Name"]%>
But the above does not work. It says DataRowView can’t be used as an expression
I will also point out that there is no paging involved.
using either
EvalorContainer.DataItemis not going to make a difference since they are the same thing. please take a look at this SO.if your browser is crashing when displaying the data, that’s because too much resulting html or javascript are being rendered at the browser. note that
Evalis executed on server side, so it’s not the root cause of browser crash.i suggest using paging to improve both performance and avoid crashing. if you really can’t use paging, how about having the user to download a csv file to open in excel or even a PDF file?
as for using Linq to SQL to improve performance, i assume you are comparing it with stored procedure or dynamic sql? stored procedure will always give you the best performance, but once your dynamic sql or linq expression (or compiled linq) is cached at sql server, they aren’t that slow compare to sproc.