I am getting a sqlserver Timeout in my aspx page. It comes when i click one of the lin开发者_如何学Ck in the website. Will indexing will help with this problem? Thanks
If you're using an ADO Command object, try to increase the number of seconds to wait while attempting to execute a command. That's set up thru ADO CommandTimeout. The default is 30 seconds.
http://www.w3schools.com/ado/prop_commandtimeout.asp
Each connection also has a timeout property in ADO, called ConnectionTimeout The default is 15 seconds.
http://www.w3schools.com/ADO/prop_conn_connectiontimeout.asp
Try and see which one hangs.
As your page brings some images from the database, and index will only help if the database engine is having to check the whole table to find those images.
Putting an index on whatever you search for could well help, but it could also be an issue related to SQL having to get the image off the disk into RAM and them sending it out across the network. Is it quicker if you store the images on the webserver and return the Filename back from the database?
If it's a query gone too slow problem - yes, if it's from something else (and it certainly might be other issue - that index will not help).
(other problems - networking, deadlocks, ect...)
精彩评论