![]() |
| |||||||
| Sponsored Links |
![]() | « Previous Thread | Next Thread » |
| | LinkBack | Thread Tools | Display Modes |
|
#1
| ||||
| ||||
| I have now launched our .NET App, but we seem to be having loads of speed issues. Some pages are taking an age to load and postback. I've tried using System.Diagnostics.Stopwatch to measure the Page Load in both the master and content pages by starting it in the Page_Init event and stopping it at the end of Page Load but the times it's coming back with don't seem to match the amount of time the page is taking to load. Everything just seems to be very slow. Any ideas on what might be causing it? At this rate we're going to have to go back to Classic ASP. Thanks |
| Sponsored Links |
|
#2
| ||||
| ||||
| Without seeing the app in action and the methods you have developed, it's hard to tell. Have you measured the time it takes for your individual queries? Are you sure you're closing all connections when you need to with in the Try..Catch...Finally blocks? Have you implemented any caching on data that does change often? Have you verified it's not a network problem?
__________________ jmurrayhead If you agree with me... click the icon! If my post solved your problem, click the button in the lower right-hand corner of the post.Join our Folding team: DeveloperBarn Folding |
|
#3
| |||||
| |||||
| Quote:
Quote:
Quote:
Quote:
Quote:
|
|
#4
| ||||
| ||||
| Quote:
Quote:
Quote:
|
|
#5
| ||||
| ||||
| You might want to try turning Tracing on -- it could give you a idea where most of the time is being spent in processing you page. (or not).
__________________ Wolffy ------------------------ Opinions expressed are my own and do not necessity reflect those of any sane person. Any code provided is intended to be an example and is provided AS IS. Rework for your specific environment may be required. Void where prohibited by law. Not valid in California. Your mileage may vary. |
|
#6
| ||||
| ||||
| Quote:
|
|
#7
| ||||
| ||||
| Sure. Take a look at ASP.NET Tutorials: Tracing in ASP.NET 2.0 for a pretty good article on the subject. |
| The Following User Says Thank You to Wolffy For This Useful Post: | ||
richyrich (August 5th, 2008) | ||
|
#8
| ||||
| ||||
| Instead of using Try Catch Finally and calling conn.close in the Finally block...you could use Using. Calling conn.close() allows the .Net garbage collector to handle the connection closing. With Using...it is closed immediately. Here's an example: Code: Dim cn As SqlConnection = New SqlConnection(_connectionString)
Dim cmd As SqlCommand = New SqlCommand("usp_GetAllRecords", cn)
Using cn
cn.Open()
Dim dr As SqlDataReader = cmd.ExecuteReader
While dr.Read
' Do something with the data
End While
End Using
|
|
#9
| ||||
| ||||
| Quote:
On your last point, within my Page_Load I use various subs to build dropdownlists and datalists on a page. I don't build anything I don't need. But, for example, on one page I have a dropdown for category, clients, introducers, users so I built a seperate sub for each dropdown/datalist to query the db and bind the data to the relevant dropdown/datalist (this was before I understand the whole layers structure). Would it be more efficient to use a List(Of ) class in each BOL to build these lists? The reason I ask is that I have a page that shows a list of current clients using a repeater. I tried 3 different methods of building the list, constructing the sql in the page and binding it, constructing it in the dal and building a List Of and using a Stored Proc to build the List Of. I found constructing the query in the Page and binding it to be the quickest method. Which method would you use for constructing dropdowns and the like? |
|
#10
| ||||
| ||||
| The beauty of Using is that no matter how you drop out of it, the connection is always closed. |
![]() |
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Open Web Page | Jaykappy | Microsoft Access | 2 | May 14th, 2008 06:32 PM |
| Slow Concat Code | AOG123 | Microsoft Access | 30 | May 8th, 2008 02:10 PM |
| go page to page questionaire app | peebman2000 | .Net Development | 3 | April 26th, 2008 04:42 PM |
| page transfer | todd2006 | JavaScript Programming | 2 | April 7th, 2008 02:26 PM |
| Alpha Page Numbers | AOG123 | Microsoft Access | 4 | March 19th, 2008 11:24 AM |