In webapplication, I put
sqlcommand.CommandTimeout=0;
Is this statement is recommended or not [good progamming style], or which one is good if it is not good?
From the SqlCommand.CommandTimeout documentation:
A value of 0 indications no limit, and should be avoided
It could cause the request and the thread processes it to hang indefinitely. This is a waste of resources if nothing else.
It would also make it harder to identify if you have commands that are not completing in a reasonable time.
is this statement is recommended or no
Not.