Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello,

I facing issue with asp.net SqlDataReader.

when i execute store procedure in sql server 2008 then it gives response within 1 second but same store procedure
execute in asp.net with SqlDataReader then it take 1 minute....

and yeah data not more, I display 1 column and near about 200 rows

How it possible this? why asp.net take more time to execute SP?

please help me...
Posted
Comments
thatraja 4-Sep-14 3:36am    
share the content of that sp

1.The SP is executed by the SQL server and not by ASP.NET and the execution time is the same on the SQL server;

2.The delay problem is generated by:
i)the amount of data read from the database,
ii)the data transfer of the results over the internet from the web server to the browser.

3.The solution is to use pagination. You could find details and source code (including SP for pagination) in my next article: Advanced ASPX GridView Pagination and Data Entities[^]
 
Share this answer
 
Comments
chetan2020 8-Sep-14 5:58am    
You are also right but my issue is other and I found that, thanx
Raul Iloc 8-Sep-14 7:32am    
Welcome!

PS: My solution was based on the info that you published in your question.
I found one issue for take more data load time in asp.net
because my database and my code both are on different server.
so it take more time for fetching data.
now I putted on same server and I getting data speedy.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900