Last post Mar 25, 2016 09:53 AM by Chris Zhao
Mar 17, 2016 02:41 PM|Alex9|LINK
Can you provide to me details about time of SqlDataReader creation and how to decrease it?
Mar 17, 2016 02:59 PM|PatriceSc|LINK
First we would need details on what happens and what you are doing. I suspect you see a delay on a SqlCommand.ExecuteReader method which IMO would point to a SQL query that is slow to run causing a delay before returning the first row? Is this is what you
If confirmed double check the query and in particular that proper indexes are used etc... If rather on readiing, make sure to retrieve only the rows/columns you need and not more (ie a blob column or thousands of rows to just show the first few dozens).
Mar 25, 2016 09:53 AM|Chris Zhao|LINK
Asp.net provides a simple way to reduce the over head by connecting to database at a minimum level by writing all the select queries in one string and connect to database through DataReader only once. This is possible by calling DataReader's NextResult()
method. So instead of writing many Select statements and many DataReader inside a single page, we can write in the above ways.
Few Tips to Increase the performance in Asp.net Applications