What William (Bill) Vaughn has said is correct.You must first try to speed up
the query.On one forum i found following
tips as to how to speed up query.
As far as the database connection timing out, if you have a lot of users you
may need to increase
the size of the connection pool. I think that the default is 20, maybe you
need more. The command
timeout is a SQL Server or possibly a networkproblem. Increasing the command
timeout is necessary
in some conditions like when you have a really big query that you know will
take a long time, but
it may be hiding a problem that should be addressed instead of worked around
with an increase
command timeout. I can not imagne that registering a user would be a complex
insert/update that
would justify increasing the command timeout. Here are some things you
should check:
1) check the performace of your queries/stored procs. If they are using
ineficient joins or doing
complex calculations you may need to do some tuning.
2) make sure you have proper indexes in place to speed your queries and
joins.
3) use a monitoring tool to look at your SQL Server performance (task
manager or performance
monitor will do) look at the memory useage and the CPU processor usage. If
your CPU is running at
90-100% for a long time then you may have a problem with #1 (bad queries or
stored procs) or you
may just need more processing power if you have a lot of users. If you SQL
Server is maxed on its
memory and is having to do a lot of paging, then you need more memory.
4) you may be experiencing some network congestion between your SQL Server
box and your
WebServer. Hopefully your servers are on the same network (I mean I hope you
are not trying to
connect to your SQL Server through the Internet, if you are then good luck,
you will always have
problems with the connection timing out). You may need to monitor the
network if you can't find
anything else wrong.
Reference :
http://dotnetjunkies.com/Forums/ShowPost.aspx?PostID=9555
If all these things does not solve your problem then as a last option you
may consider increasing command time out value at application level in
following manner:
ADO.NET, there is a CommandTimeout property of the command object that
defaults to 30 seconds. A specification of 0 means infinite.You can also set
this value at application level by following code:
System.Data.IDbCommand.CommandTimeout = 50;
Hope this helps.
--
If my answer helped you,then please do press Yes below.
Thanks and Regards.
Manish Bafna.
MCP and MCTS.